Using table for each date group within the loop
-
Any help appreciated: I want to be able to display the date and group of posts within that date in a table with two columns. The date in one column and the posts in another. The problem is I don’t know how to include the HTML to close the cell, row and table tags after group of posts in that date within the loop. Is this possible?
Here is a basic outline of what I want for each date:
<table> <tr> <td> THE DATE </td> <td> POSTS LISTED HERE </td> </tr> </table>So my template code is along the lines of:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php the_date('j F', '<table><tr><td>', '</td><td>' <?php the_title(); ?> etc... etc... <!--THIS IS WHERE I DON'T KNOW HOW TO CODE TO CLOSE THE TABLE AT THE END OF THE DATE-> <?php endwhile; ?> <?php endif; ?>If I close the TD, TR and TABLE tags where I currently have the comment it adds them to the end of every post listed.
Thanks in advance for any help.
The topic ‘Using table for each date group within the loop’ is closed to new replies.