avoid featured post duplication in wordpress
-
i have a homepage with multiple WP_query loops and i want to prevent the featured post from showing up in its specific category loop at the same time. i only want it to show up in the category loop when it is no longer the featured post.
here is my featured loop:
<?php $featuredPost = new WP_Query(); $featuredPost->query('showposts=1&category_name=featured'); while ($featuredPost->have_posts()) : $featuredPost->the_post(); stuff <?php endwhile; ?> here are my category loops: <?php $categoryPost = new WP_Query(); $categoryPost->query('showposts=3&category_name=news'); while ($categoryPost->have_posts()) : $categoryPost->the_post(); stuff <?php endwhile; ?> <br/> <?php $categoryPost = new WP_Query(); $categoryPost->query('showposts=3&category_name=sport'); while ($categoryPost->have_posts()) : $categoryPost->the_post(); stuff <?php endwhile; ?> <br/> <?php $categoryPost = new WP_Query(); $categoryPost->query('showposts=3&category_name=art'); while ($categoryPost->have_posts()) : $categoryPost->the_post(); stuff <?php endwhile; ?>
any help would be much appreciated.
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘avoid featured post duplication in wordpress’ is closed to new replies.