I used the guide on the codex page about the loop to extract the most recent post of a featured category to be at the top of my page.
But now I’m realizing that when I click ‘older posts’ on the bottom of my page, the archives still show this post at the top. I have no idea how to do this.. but I feel that it shouldn’t be toooo hard..
The code I used was based off this (from the codex)
<?php $my_query = new WP_Query('category_name=featured&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> <!-- Do stuff... --> <?php endwhile; ?> <!-- Do other stuff... --> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <!-- Do stuff... --> <?php endwhile; endif; ?>
- The topic ‘how to exclude featured category from previous posts?’ is closed to new replies.