There is a site on wordpress
, in the block of output of posts of which there is a query_posts
query and a standard while (have_posts()) : the_post();
.
<?php query_posts('showposts=6&cat=98,100,97,99'); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> ... <?php endwhile; ?> <div class="home-post-block"> <?php echo adrotate_ad(1);?> </div> <div class="home-post-block"> <?php echo adrotate_ad(2);?> </div> <div class="home-post-block"> <?php echo adrotate_ad(3);?> </div> <?php endif; ?>
I have the adrotate
banner ad adrotate
, whose ads I want to display in the same block if they are active
<div class="home-post-block"> <?php echo adrotate_ad(2);?> </div>
Question: how to do this technically? I think that somehow, but something is not right here ...
<?php $count=0; if(adrotate_ad(1) && adrotate_ad(2) && adrotate_ad(3) { $count=3; } else if (adrotate_ad(1) && adrotate_ad(2)) { $count=4; } else if (adrotate_ad(2) && adrotate_ad(3)) { $count=4; } else if (adrotate_ad(1) && adrotate_ad(3)) { $count=4; } else if (adrotate_ad(1) || adrotate_ad(2) || adrotate_ad(3)) { $count=5; } else { $count=6; } query_posts('showposts=$count&cat=98,100,97,99'); ?>