File: /www/wwwroot/www.sceybwg.com/wp-content/themes/Modular/template/module-page/theme-faq-2.php
<?php
/**
* Template: 时间轴
* @Author: 大胡子
* @Email: dahuzi@xintheme.com
* @Link: www.xintheme.com
* @Date: 2023-08-01 07:27:28
* @Last Modified by: dahuzi
* @Last Modified time: 2024-11-15 20:25:45
*/
if(is_array($module_content)){?>
<div class="section"<?php if( !empty($module_setting['module_bg']) ){ echo ' style="background:url('.$module_setting['module_bg'].') no-repeat center 0 / cover;"';}?>>
<div class="container">
<div class="faq-inner">
<?php if( !empty($module_setting['title_display']) ){?>
<div class="faq-title">
<div class="title-panel <?php echo $wow_style;?>">
<?php
if( !empty($module_title) ){
echo '<h2>'.$module_title.'</h2>';
}
if( !empty($module_desc) ){
echo '<p>'.$module_desc.'</p>';
}
$more_btn_text = $module_content['more_btn_text'] ?? '';
$more_btn_url = $module_content['more_btn_url'] ?? '#';
$more_btn_blank = !empty($module_content['more_btn_blank']) ? ' target="_blank"' : '';
if (!empty($more_btn_text)) {
echo "<a href=\"$more_btn_url\"$more_btn_blank>";
echo "<span>$more_btn_text</span>";
echo '<i class="ri-arrow-right-line"></i>';
echo '</a>';
}
?>
</div>
</div>
<?php }?>
<?php
if (!empty($module_content['faq_id'])) {
// 获取指定 ID 的文章
$faqArray = array(
'post_type' => 'faq',
'post__in' => $module_content['faq_id'],
'orderby' => 'post__in',
);
$faq_query = wpjam_query($faqArray);
if ($faq_query->have_posts()) {
echo '<div class="faq-list">';
echo '<ul>';
// 不使用 div 包裹,直接输出文章内容
while ($faq_query->have_posts()) {
$faq_query->the_post();
?>
<li class="post-accordion">
<h3 class="accordion-title"><?php the_title();?></h3>
<div class="accordion-desc">
<?php the_content();?>
</div>
</li>
<?php
}
echo '</div>';
echo '</ul>';
}
}
?>
</div>
</div>
</div>
<?php }
//echo wpjam_print_r( $module_setting );
//echo wpjam_print_r( $module_content );
//echo wpjam_print_r( $module_style );