Good afternoon, all,
I’m probably not thinking this through properly, but I’ve been staring at this for hours with no end in sight 😉
For my archive page I have:
{exp:channel:entries channel="blog"}
<section class="archive">
{date_heading display="yearly"}
<strong>{entry_date format="%Y"}</strong>
{/date_heading}
{entry_date format="%M %j"}
<h2><a href="http://{url_title_path=blog/}">{title}</a></h2>
<p></section><br />
{/exp:channel:entries}Produces something along the lines of:
2012 Title Title Sep 3
Title Title Aug 21
2011 Title Title Sep 15
or:
<section class="archive">
<strong>2012</strong>
Sep 3
<h2><a href="http://">Title Title</a></h2>
<p></section></p>
<p><section class="archive"><br />
Aug 21<br />
</p><h2><a href="http://">Title Title</a></h2>
<p></section></p>
<p><section class="archive"><br />
<strong>2011</strong><br />
Sep 15<br />
</p><h2><a href="http://">Title Title</a></h2>
<p></section>However this is not quite what I need. I would like the <section></section> tags to wrap around all the entries for each year, not around every entry (within a year or not). I.e.
<section class="archive">
<strong>2012</strong>
Sep 3
<h2><a href="http://">Title Title</a></h2>
<p> Aug 21<br />
</p><h2><a href="http://">Title Title</a></h2>
<p></section></p>
<p><section class="archive"><br />
<strong>2011</strong><br />
Sep 15<br />
</p><h2><a href="http://">Title Title</a></h2>
<p></section>Any thoughts? Many thanks in advance!!