I need to show a heading over a category and it must only be shown if there are posts in the category in WordPress. The heading should not be placed over every post. How can it be solved?
The code I got right now:
<?php query_posts('category_name=onestar&showposts=5'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="wrapper orangecolor">
<article class="intro">
<h2><?php the_title(); ?></h2>
<div><?php the_content(); ?></div>
</article>
</div>
<?php endwhile; ?>
<?php endif; ?>
1 comment