HEX
Server: nginx/1.24.0
System: Linux iZm5eic9piryinoecjybjoZ 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: www (1000)
PHP: 8.2.28
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/h3.iyingtaos.cn/wp-content/themes/three-picture/index.php
<?php
get_header();
$mulu=get_template_directory_uri();
?> 

<link rel="stylesheet" href="<?php echo $mulu; ?>/lunbo.css">  
</head>
<main class="container">
<div class="main-box">
<div class="header"><a style="text-decoration: none;
    color: white;" href="<?php  echo esc_url(home_url('/'))?>"><?php bloginfo(); ?></a></div>  
<div class="nav">  
   <?php
        $args=array(
        'orderby' => 'count',
        'hide_empty' => true, //隐藏不带文章的分类
        'order' => 'DESC'
        );
        $categories = get_categories($args);
        foreach ($categories as $index=>$category) {
            $active_class = ($index === 0) ? '' : '';
            echo '<div class="nav-item"><a class="'.$active_class.'" href="' . esc_url(get_category_link($category->term_id)) . '">' .  esc_html($category->name) . '</a></div>';
        }
        $fenlei=single_cat_title('',false);
      
    ?>
</div>

<?php   get_template_part('templates/xinxiliu');  ?>
<?php
$counter=0;
$initial_query = new WP_Query(array(  
        'post_type' => 'post',  
        'posts_per_page' => 10, // 初始加载的文章数量  
    ));  
while ($initial_query->have_posts()) {  
    $initial_query->the_post();  
    $lianjie=get_permalink();
    $counter++;
    if ($counter < 4) {
         if ($counter == 1) {
        echo ' <div class="lb">
        <div class="swiper-container">
        <div class="swiper-wrapper">';
         }
            $thumbnail_image_url = wp_get_attachment_image_url(get_post_thumbnail_id($post->ID), 'thumbnail');
        echo '
            <div class="swiper-slide" data-hash="slide' . $counter . '"><a href="'.$lianjie.'"><img  src="'.$thumbnail_image_url.'"></a>
            <div class="lb-title"><a>'.get_the_title().'</a></div>
            </div>
            ';
        if ($counter == 3) {
            echo '
            </div>
            <!-- Add Pagination -->
            <div class="swiper-pagination"></div>
            <!-- Add Arrows -->
            </div>
            </div>
        ';
        get_template_part('templates/xinxiliu'); 
        }
    }else{
        get_template_part('templates/lists');
        get_template_part('templates/xinxiliu');
    }
}wp_reset_postdata();
?>
</div>
<?php  get_template_part('templates/loading'); ?>
</main>
<div class="loading-indicator" style="display:none; text-align:center;">
    <p>正在加载...</p>
</div>
<?php
get_footer();
?>
<script>var a=document.querySelector('.nav'); console.log(a)</script>