I'm trying to create a taxonomy term archive that can group items by post type. I've come close to the intended result using Layouts - I generated separate views for each post type and passed the "current archive page" through the taxonomy filter. The problem with layouts is that it generates a lot of additional markup, and I don't necessarily want to use Bootstrap for the layout. The problem with WordPress archives or content templates is that they loop through the template for as many times as there are posts assigned to that term.
I appreciate I'm using the WordPress archive in rather an odd way. Instead of sequentially looping through every post with the taxonomy term, I'm passing that term through to separate views for specific post types, which then return only the posts with said term.
Is this feasible using Toolset, or will it require a custom solution? Any advice is much appreciated.
Is there any documentation that you are following?
I've searched the documentation for WordPress archives, views, content templates, and layouts.
Is there a similar example that we can see?
No.
What is the link to your site?
hidden link
Hello,
It is possible, I assume we are talking about this case:
Taxonomy:
- "Topic"
custom post types:
- cpt 1
- cpt 2
...
you can try these:
1) Create multiple posts views(each view is for only one post type):
- Query posts of one post type only
- Filter by:
Select posts with taxonomy:
Topic the same as the current archive page
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
- In view's loop display the post information
2) Create a Views WordPress Archive for taxonomy "Topic", in section "Loop Editor", just below shortcode [wpv-items-found], display above post view's shortcodes.
https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/designing-an-archive-without-any-page-builder/
As easy as that! Thank you, Luo! That's just what I was looking for.