【发布时间】:2015-01-09 01:50:12
【问题描述】:
我想显示具有特定标签但没有其他特定标签的帖子列表。例如,我尝试了以下方法来显示具有“动物”标签的帖子列表。
<?php
$args = array(
'numberposts' => 1,
'tag' => 'animal',
'showposts' => 8
);
$query = new WP_Query($args);
if($query->have_posts()):
echo '<table>';
while($query->have_posts()): $query->the_post();
the_title(); ?> </a></td>
endwhile;
endif;
wp_reset_query();
?>
例如,我们如何在“动物”标签中而不是在“猫”标签中显示帖子列表? 我对 wordpress 很陌生,刚刚学会了创建自定义页面。
【问题讨论】: