Skip Navigation

[Resolved] Create taxonomy term archive that can group items by post type

This thread is resolved. Here is a description of the problem and solution.

0% of people find this useful.

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Chris 5 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1362147

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

#1362343

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/

#1363501

As easy as that! Thank you, Luo! That's just what I was looking for.