HEX
Server: Apache
System: Linux top 5.8.11-1.el7.elrepo.x86_64 #1 SMP Tue Sep 22 18:18:35 EDT 2020 x86_64
User: www (1000)
PHP: 7.4.33
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.018111.cn/wp-content/themes/jian/pages/archives.php
<?php
/**
 * Template name: 存档页面
 * Description:   A archives page
 */
get_header();
?>

<div class="container">
    <div class="row">
        <div class="article-content col-lg-12">
            <div class="content-area">
                <main class="site-main">

                    <article id="post-<?php the_ID(); ?>" <?php post_class( 'post archives' ); ?>>

                      <div class="container">
                       <?php
                        $previous_year = $year = 0;
                        $previous_month = $month = 0;
                        $ul_open = false;
                        $numberposts = _cao('zhuanti_postnum','30');
                        $myposts = get_posts('numberposts='.$numberposts.'&orderby=post_date&order=DESC');
                        foreach($myposts as $post) :
                            setup_postdata($post);
                            $year = mysql2date('Y', $post->post_date);
                            $month = mysql2date('n', $post->post_date);
                            $day = mysql2date('j', $post->post_date);
                            if($year != $previous_year || $month != $previous_month) :
                                if($ul_open == true) : 
                                    echo '</ul></div>';
                                endif;
                         
                                echo '<div class="item"><h3>'; echo the_time('F Y'); echo '</h3>';
                                echo '<ul class="archives-list">';
                                $ul_open = true;
                            endif;
                            $previous_year = $year; $previous_month = $month;

                        ?>
                            <li>
                                <time><?php the_time('j'); ?>日</time>
                                <a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a>
                                <span class="text-muted"><?php comments_number('', '1评论', '%评论'); ?></span>
                            </li>
                        <?php endforeach; ?>
                        </ul>
                      </div>
                    </article>

                </main>
            </div>
        </div>
    </div>
</div>

<?php get_footer(); ?>