Navigation überspringen

[Gelöst] Recommendation for custom archive for custom taxonomy that includes 4 CPTs

This support ticket is created vor 2 years. 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
- 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 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 reply, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 2 years.

Assistiert von: Minesh.

Author
Artikel
#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?

versteckter Link

we want it like this

versteckter Link

What is the link to your site?

versteckter Link

#2697908

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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/