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/loop/list-three.php
<?php

/**
 * Template: 分类列表样式-3
 * @Author: 大胡子
 * @Email:  dahuzi@xintheme.com
 * @Link:   www.xintheme.com
 * @Date:   2022-08-05 17:29:40
 * @Last Modified by:   dahuzi
 * @Last Modified time: 2024-08-31 15:50:43
 */

//兼容筛选
if (isset($_POST['category_id'])) {
	$cat = intval($_POST['category_id']);
}

//根分类
$cat_id = get_category_root_id($cat);

//分类列表 文章缩略图
$list_three_thumb = get_term_meta($cat, 'list_three_thumb', true) ?? '';

if( !empty( $list_three_thumb ) ){
	$list_three_thumb = $list_three_thumb;
}elseif( !empty( $cat_id ) ){
	$list_three_thumb = get_term_meta($cat_id, 'list_three_thumb', true) ?? '';
}

if( is_tag() || is_search() ) {
	$list_three_thumb = true;
}

//获取文章缩略图
$get_post_thumbnail_url = wpjam_get_post_thumbnail_url();

//图片Alt标签
if(!empty($get_post_thumbnail_url)){
	$img_alt = get_the_title();
}
?>
<div class="post-item">
	<a href="<?php the_permalink();?>">
		<?php
		if(!empty($list_three_thumb) && !empty($get_post_thumbnail_url) ){
			echo '<div class="img-center">';
			echo '<img loading="lazy" src="'.$get_post_thumbnail_url.'" alt="'.$img_alt.'">';
			echo '</div>';
		}?>
		<div class="text">
			<h2><?php the_title();?></h2>
			<div class="time">
				<span><?php echo get_the_date();?></span>
			</div>
			<?php dahuzi_excerpt( 180, '...' );?>
		</div>
	</a>
</div>