Group By Articles Date
-
There are a few other topics similar but they don’t answer this question:
How do you group posts together in the loop without the box closing around each one?If I put in a tag just after the begining of the loop and just before the end it closes for each post. The closing Tag has to appear and disappear depending on the date.
I’m trying something different, I’m trying to group the days posts by using the <fieldset> tag and have the date as the <legend> tag. Not too prominent a colour but thats CSS and easy ??
Anyway, the best way I can think of to do it is have a conditional tag insertion best possible way I think of is:
/*** BEGIN THE LOOP ***/...
<fieldset>
<legend> <?php the_date(); ?> </legend>A BUNCH OF POST CONTENT
if (date_this_post != date_last_post) {
</fieldset>
}...
/*** END THE LOOP ***/
Would it be acceptable to create a varible to temporarily store the date to compare to the next post?
But how detremental to page generation time would that be?
- The topic ‘Group By Articles Date’ is closed to new replies.