You could do this with multiple loops, but given that you simply want to show ten posts with the first five different than the last five, I’d do it as one loop with a conditional to show the last five posts differently.
<?php
counter=0;
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
counter++;
if (counter <= 5)
{
// show the post like the first five posts
}
else
{
// show the post like the second five posts
}
endwhile;
else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php
endif;
?>
Thread Starter
cogo
(@cogo)
Looks logical. My php editing skills are a bit limited however. Here’s the code I’m using now together with where I want the next five to appear:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="date">
<span style="font-size: 20px; line-height: 95%;"><?php the_time('d')?></span><br />
<span style="font-size: 20px; font-weight: bold; line-height: 62%;"><?php the_time('m')?></span><br />
<?php the_time('Y')?>
</div>
<div class="post" id="post-<?php the_ID(); ?>">
<ul>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Read <?php the_title(); ?>"><?php the_title(); ?></a><br /><span class="post-flings">Categories: <?php the_category(', ') ?> | Comments: <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></li>
</ul>
</div>
<?php endwhile; ?>
<div class="navigation">
<?php next_posts_link('<div class="alignleft">Previous Entries</div>') ?>
<?php previous_posts_link('<div class="alignright">Next Entries</div>') ?>
</div>
<div style="clear: both; padding-top: 23px;">
>>>NEXT FIVE HERE<<<
</div>
<p />
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php include (TEMPLATEPATH . "/searchform.php"); ?>
<?php endif; ?>