Add div to group posts by date?
-
Hi everyone,
I’m having problems adding a div to a group of posts that are written on a particular date. This is the code I’m using:<?php $args = array( 'post_type'=>'wlinks' ); query_posts( $args ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php the_date('','<div><h2>','</h2>'); ?> <?php the_title(); ?><br /></div> <?php endwhile; ?> <?php else : ?> <?php endif; ?>
Website where the problem occurs: https://alttv.net/files/linkroll.php
It’s fine if I have only one post but the problem is if there are more than one post, the first post is in the div and the rest are outside the div. I would like to group all post by date in a div.
Here’s a graphical example of the problem:
<div>
<title>
<post>
</div>
<post>
<post>What I’m trying to accomplish:
<div>
<title>
<post>
<post>
<post>
</div>Thanks for the help,
Gregory S.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add div to group posts by date?’ is closed to new replies.