Wrapping a <div> around the 2nd-7th most recent posts
-
Hi,
I need to “wrap” a div around the 2nd-7th most recent posts, so that it looks something like this:<div id="entry-1">
<a post 1 stuff></a>
</div><div id="entry">
<a post 2 stuff></a>
<a post 3 stuff></a>
<a ...... stuff></a>
<a post 7 stuff></a>
</div>At the moment it looks like:
<div id="entry-1">
<a post 1 stuff></a>
</div>
<div id="entry">
<a post 2 stuff></a>
</div>
<div id="entry">
<a post 3 stuff></a>
</div><br />
etc etcI am using:
<?php $postclass = ($post == $posts[0]) ? 'entry-1' : 'entry'; ?>
to make the most recent post be distinguishable from the rest and am using:
<div id="<?php echo $postclass; ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
<img class="<?php echo $postclass; ?>"
src="<?php the_excerpt_rss(); ?>"></a>
</div>to achieve this.
I was thinking that I could have the most recent post kept seperate from the rest but I can’t work out how to seperate them and I can’t work out how to wrap the <div> around the other 6 posts.
I’ve never used php (but I’m fairly good at html and css) but it might be obvious; any help is greatly appreciated.
- The topic ‘Wrapping a <div> around the 2nd-7th most recent posts’ is closed to new replies.