我想查询特定类别中的帖子并在我的 WordPress 起始页上显示整个帖子。我已经用这段代码尝试过了:
<?php
$args = array(
'cat' => 3,
'order' => 'ASC'
);
query_posts( $args );
while ( have_posts() ) : the_post();
echo '<li>';
the_title();
echo '</li>';
endwhile;
wp_reset_query();
?>
WordPress 不显示整个帖子,而是仅显示我帖子的标题。 我该怎么做才能显示帖子的内容而不是标题?
最佳答案
试试这个
while ( have_posts() ) : the_post();
echo '<li>';
the_content();
echo '</li>';
endwhile;
参见The Loop in Action供引用
关于php - 自定义 WordPress 发布查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17149937/