have_posts() inaccurate output
-
Heya,
I’m working on a custom theme and the simple PHP function I’m using to determine if a post exists isn’t working. Any idea why this might be?
<?php if(have_posts()) : ?> post found <?php else : ?> <?php echo wpautop('Sorry, no posts were found'); ?> <?php endif; ?>The only post is the default “Hello World!”.
This code displays “post found” whether I’ve deleted the post, or the post is active.
I don’t get the “Sorry, no posts were found” message after moving the post to the trash. I’ve cleared my cache.
Appreciate any help
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘have_posts() inaccurate output’ is closed to new replies.