Skip Navigation

[Resolved] Recommendation for custom archive for custom taxonomy that includes 4 CPTs

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 6 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2697713

Tell us what you are trying to do? Create a custom archive for a taxonomy that has different sections for different post types. Example. Our site has 4 post types that currently use a custom taxonomy Language. They are books, audiobooks, bundles, extras. We are using Blocksy theme. Default archive shows all four post types interspersed. We would like to show them each in seperate section by type. I know I can create a custom page to do this. Can we replace the archive so when it the taxonomy is displayed it can go to page with them seperated. Just looking for best practice. I have same issue with standard tags.

Is there any documentation that you are following?

Couldn't find

Is there a similar example that we can see?

hidden link

we want it like this

hidden link

What is the link to your site?

hidden link

#2697908

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no way to group posts by post type on taxonomy archive.

The possible workaround would be:
- You can create a taxonomy archive in classic mode (without using blocks)
- Create views per post type (if you have four post types then create four views) and add the query filter to filter this view with your custom taxonomy - for instance taxonomy is "Book Authors":

Taxonomy filter
Select posts with taxonomy: Book Authors the same as the current archive page

- add the four views outside the archive's loop

We can optimize this again by creating one view and we can pass the post type as view's shortcode argument but that will require custom code using view's filter hook "wpv_filter_query":

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/filtering-views-by-taxonomy/