This should be very easy, however for some reason I can't find a working snippet anywhere on the web.. I basically need to display one latest post from 6 categories (can be changed to 7,8, etc etc) using one loop. this should be the output: (just a demonstration)
<div class=box>
<h2>name of category 1</h2>
<a href="">The title and the permalink of the latest one post from category 1</a>
</div>
<div class=box>
<h2>name of category 2</h2>
<a href="">The title and the permalink of the latest one post from category 2</a>
</div>
<div class=box>
<h2>name of category 3</h2>
<a href="">The title and the permalink of the latest one post from category 3</a>
</div>
For now I am using 6 loops using simple query:
<?php query_posts('showposts=1&cat=8'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
//Title, links etc comes her....
<?php endwhile; ?>
But that makes me create 6 loops and I would like to do it easier using one loop and a possibility to control how many and which catefories I want to display.
Thanks A lot