HEX
Server: nginx/1.16.1
System: Linux VM-0-14-centos 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1000)
PHP: 8.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
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 );