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/single.php
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="<?php echo get_stylesheet_uri() ?>">
<script src="<?php echo get_template_directory_uri() ?>/jquery-3.6.js"></script>
<title><?php the_title(); ?></title>
</head>

<div class="header header2">
    <a href="<?php  echo esc_url(home_url('/'))?>">返回</a>
    <span><?php bloginfo(); ?></span>
</div>  

<main class="main">
	<?php   get_template_part('templates/xinxiliu');  ?>
    <div class="title">
        <?php
        	the_post();
	        the_title('<h3>','</h3>');
	        // the_author();//输出作者名称
        ?>
        <span class="time"><?php the_time('Y-m-d');?> </span>
    </div>

	<?php   get_template_part('templates/xinxiliu');  ?>
    <div class="content">
        <?php 
        the_content();
        wp_link_pages(array(
                    'before' => '<div class="page-links">' . __( '页码:', 'textdomain' ),  
                    'after'  => '</div>',  
                    'link_before' => '<span>',  
                    'link_after'  => '</span>',  
                    'pagelink' => '%',  
                    'echo' => 1  ,
                    'next_or_number' => 'next', // 显示数字链接或“下一页”
                    'nextpagelink' => __('下一页', 'textdomain'),
                    'previouspagelink' => __('上一页', 'textdomain'),
        ));
        ?>
    </div>
	<?php   get_template_part('templates/xinxiliu');  ?>
    <div class="foot">
        <h4>最新文章</h4>
    </div>
    <?php //get_sidebar(); 
$args = array(
    'post_type' => 'post', // 指定文章类型
    'posts_per_page' => 5, // 获取最新的 5 篇文章
);
$latest_posts = new WP_Query($args);
    while ($latest_posts->have_posts()) {
        $latest_posts->the_post(); // 设置全局 $post
        // 现在可以安全地使用模板标签
        $lianjie=get_permalink();
        $read_count = get_post_meta(get_the_ID(), 'read_count', true)?:rand(10000,20000);
     
		$categories = get_the_category();
        // 如果有多个分类,可以选择第一个分类或其他逻辑
        $first_category = $categories[0]; // 获取第一个分类
        $fenlei = esc_html($first_category->name); // 获取分类名称
        
        $thumbnail_image_url = wp_get_attachment_image_url(get_post_thumbnail_id($post->ID), 'thumbnail');
           echo '<a class="list" href="'.$lianjie.'">';

            echo '<div class="listpic">
	 	  	 	<img src="'.$thumbnail_image_url.'">
	 	  	 </div>
	 	  	 <dl class="listcont">
	 	  	    <dt class="listtitle"> '.get_the_title().'</dt>
	 	  	    <dd class="listmore">
	 	  	    	<p class="listtag"> <span>'.$fenlei.'</span></p>
	 	  	   	 <!--<p class="listread" style="color: #000;font-size: 16px;text-align: right;padding-right: 1.333vw;"><span>'.$read_count.'</span></p>-->
			 <p class="listread"> <span>阅读</span><span>'.$read_count.'</span></p>
	 	  	    </dd>
	 	  	 </dl>
	 	</a> ';
        get_template_part('templates/xinxiliu');
    }
    wp_reset_postdata(); // 重置全局 $post 变量
?>
</main>
<span style="text-align: center;display:block; font-size:12px;"><a style="color:#586b95;" href="https://beian.miit.gov.cn/">冀ICP备2022013850号-2
</a></span><?php
get_footer();
?>