Magazine-style WordPress themes seem to be the latest craze spreading throughout the community and why not? Instead of presenting your posts in the standard blog format (chronological order) you can pick and choose which sections to display and how many entries from each section.
Most if not all magazine-style themes contain a "featured" section or some such thing highlighting a post from a category of your choosing and a "recent news" section listing your most recent posts. The problem with this is you can have the same post appearing in both sections, something many users don't want. So the question is how do we exclude a "featured" post from appearing in the "recent news" section? We can do this by using the query_posts function and passing the offset= argument to it.
Let's use the popular NewsWeek theme as an example. The front page displays a section called Featured Article and immediately after that is another called Latest Articles. Open up index.php (which is the template file this theme uses to display the front page) and underneath the Featured Article section you will see this bit of code,
<div class="posts" >
<h3>Latest Articles</h3>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
---
</div>
Right before The Loop add the following,
<?php query_posts('showposts=5&offset=1'); ?>
What this will do is output a list of 5 posts after the most recent thanks to the offset= argument. This will prevent a featured post from appearing in the latest section. Of course you can adjust the showposts= argument to whatever you want. This will override your settings in the admin panel.
Now this will vary depending on how your theme is constructed. Let's use another example - another site I have. The theme that currently powers riteturnonly.com is called Indomagz. If you view the image below (click to enlarge) you will see that my "featured" section pulls posts from the WordPress category and to the immediate bottom right is a list of recent entries from the same category.
The template file that my front page uses is home.php. The code that outputs the latest entries from the WordPress category (beneath the "featured" section) is...
<div class="content2-right">
<?php $recent = new WP_Query("cat=18&showposts=5&offset=1"); ?>
---
</div>
Notice how I'm using the offset= argument? This will prevent the featured article from appearing in the latest section.
