以下代码输出帖子标题列表。在此列表下方,它还会输出与类别8中的标签“test”匹配的每个完整帖子。为什么它会输出完整帖子?我如何防止这种情况发生?为什么WordPress的循环输出完整的帖子?
$query_str = "cat=8&tag=test";
query_posts($query_str);
while (have_posts()) : the_post();
echo '<div><a href="';
the_permalink();
echo '">';
the_title();
echo '</a></div>';
endwhile;
你的意思是它的输出'the_content'呢? – 2013-03-15 15:26:55
是的,但没有标题。 – 4thSpace 2013-03-15 15:28:04