Condition for count to display

<?php
$count = 0;
$my_query = new WP_Query(‘post_type=Event&posts_per_page=-1’);
while ($my_query->have_posts()) : $my_query->the_post();
$count++;
endwhile;
wp_reset_query();
//echo $count;
if($count <= 5){?>
<div class=”info-text”>
<?php if(!empty($seltop_options[‘welcometext’])) {?>
<h1><?php echo $seltop_options[‘welcometext’]; ?></h1>
<?php } ?>
</div>
<?php } ?>

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: