Hi Luo,
Thank you so much. The snippet was not activated. I activated it and the archive worked as desired.
I have a follow-up question about styling the list of posts.
I want to display the posts as an unordered list within each group of dates. Right now, the "ul" repeats itself each time for the loop, and I am getting spaces in between each item. The Inspector confirms that this is what's happening. See screenshots.
Here's the code I have in the Loop Editor:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[heading condition="year" value="[wpv-post-date format="Y"]"]
<h4>[wpv-post-date format="Y"]</h4>
[/heading]
[heading condition="month" value="[wpv-post-date format="F"]"]
<h5>[wpv-post-date format="F"]</h5>
[/heading]
<ul>
<li>[wpv-post-link]</li>
</ul>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
Is there any way to get just the "li" items to repeat and not the entire "ul" group?
Thank you for your help.
-Liat
Hello,
You can try to move the HTML
tags outsider <wpv-loop> ... </wpv-loop>, for example:
<ul>
<wpv-loop>
...
</wpv-loop>
</ul>
Is there any way to add a space after the last Post result before the next heading? The way it shows up right now makes it hard to read. See screenshot.
I do not want spaces between the Post links, just after each group of post links.
Here is my current code:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[heading condition="year" value="[wpv-post-date format="Y"]"]
<h3>[wpv-post-date format="Y"]</h3>
[/heading]
[heading condition="month" value="[wpv-post-date format="F"]"]
<h4>[wpv-post-date format="F"]</h4>
[/heading]
<span class="lato">[wpv-post-link]</span><br>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
Thank you!
For the new question:
Is there any way to add a space after the last Post result before the next heading? The way it shows up right now makes it hard to read. See screenshot.
You can add the space before the [heading] shortcodes:
For example:
<br />
[heading condition="year" value="[wpv-post-date format="Y"]"]
...
<br />
[heading condition="month" value="[wpv-post-date format="F"]"]
Thanks Luo. These formatting tips didn't work for me in this case. Adding the "br" tags before the headings resulted in extra space between each of the posts as well. I'll stop bothering you with formatting questions.
Thanks, Liat