admin管理员组文章数量:1404345
I'm used to writing complex WP queries, but am currently stumped. On a new website I have a dozen published posts, but the basic loop in WordPress doesn't find them.
<?php
$the_query = new WP_Query($args);
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
} else {
echo 'no posts found';
}
wp_reset_postdata();
?>
I just get "no posts found" returned. What could the issue be?
本文标签: wp queryWPQuery not returning any posts
版权声明:本文标题:wp query - WP_Query not returning any posts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744786468a2625030.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论