Display Title Once if Loop has posts
-
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>I’m using the loop to pull posts, etc.. I have a header above the posts that I want to display only if there are posts.. and when there are no posts, don’t display the header at all.
How would I break up the loop to throw something in the “if” so that the header displays if there are posts, then the while continues so the header doesn’t repeat for every post?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Display Title Once if Loop has posts’ is closed to new replies.