Check if any published posts exist?
-
I’m using a custom post type on a page, but I only want to display posts (and all the extra content on that page) if any exist. I’m not sure how to write “check if there are any posts. If so, show all this stuff [code], else don't show anything"
Does anyone know how to do this?
Here's what I have right now:
<?php query_posts( array( 'events' => 'recurring-event','showposts' => $postsperpage,'paged'=>$paged ) ); ?> <? if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
Thanks for any assitance!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Check if any published posts exist?’ is closed to new replies.