Tell us what you are trying to do? I want to create a list that shows the years for which there are existing blog posts and then a sub-list with the months for which there are existing blog posts, which links to each date-related archive page.
I've done this before with no problem for things like product categories + subcategories, but I can't find a way to list out the archive pages based on date. I can customize those archive pages using views, but not use a shortcode to link to them?
Is there any documentation that you are following? Views query by date; custom search; shortcodes for archives
Is there a similar example that we can see? Screenshot attached
What is the link to your site? hidden link
Here is as tech bulletin entry that explains how to do exactly what you need.
https://toolset.com/2013/10/how-to-group-views-results-by-year-and-month/
I tested this and it successfully groups Years (Output only once each) and Months, plus posts.
Front here it should be easy to group them in Additional HTML like accordions or link to other pages.
For reference, I will consult the code provided in the above bulletin with the developer as it seems wrong to me, and I needed to adjust the shortcodes a little:
<wpv-loop>
[heading condition="year" value="[wpv-post-date format='Y']"]
<h4>[wpv-post-date format="Y" id="[wpv-post-id]"]</h4>
[/heading]
[heading condition="month" value="[wpv-post-date format='F']"]
<h5>[wpv-post-date format="F" id="[wpv-post-id]"]</h5>
[/heading]
<h4>[wpv-post-title][wpv-post-date]</h4>
</wpv-loop>
I added the Post ID
The rest worked as is.
Please let me know if this helps-
I found this tutorial while I was searching support, but it doesn't do quite what I'm hoping for.
Because it's not actually applying any filter to the query result, the [wpv-items-count] shortcode doesn't return the number of posts in that month or year, it returns the total number of posts. (see screenshot)
I understand. This is not possible with this ShortCode.
I can customize those archive pages using views, but not use a shortcode to link to them?
Right, we do not have a ShortCode linking to either the Year archives, Month archives or Day archives.
But that should not be needed, you can craft a Custom Link similar to this:
<a href="[wpv-bloginfo show='url']/[wpv-post-date format='Y']">[wpv-post-date format="Y"]</a>
The post count thou is another issue.
Here we would need to alter each query but that is not possible within the Query Filters of the very View, these would affect all posts.
So you would need a second, nested View, with a Query that takes the date from a ShortCode attribute and returns only the Post Count.
Then, add the [wpv-items-count] above the Loop of this new View.
After, insert the View in the Loop of your first View, as this:
[wpv-view name="post-count-per-year" year="[wpv-post-date format='Y']"]
Unfortunately the feature you require is not inbuilt natively in Toolset, but it is achievable with above steps.
I can suggest this with a "adequate" amount of data. If you plan to have 10s of thousands of posts, I suggest to not use Toolset Views for this, as nesting the Views can result in a high load with the increasing amount of posts.
I speak of large amounts.
Please let me know if with these steps you are able to achieve the result you wish?
Yes, this works. Thank you!