wp query - WP_Query not returning any posts

I'm used to writing complex WP queries, but am currently stumped. On a new website I have a dozen published posts,

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744786468a4593657.html

相关推荐

  • wp query - WP_Query not returning any posts

    I'm used to writing complex WP queries, but am currently stumped. On a new website I have a dozen published posts,

    2天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信