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
评论列表(0条)