Skip Navigation

[Resolved] i need to display the archive only for a product category, not for all products

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.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 4 years, 4 months ago.

Assigned support staff: Nigel.

Author
Posts
#406233

I am trying to: created different archive views for different product categories. So far I saw I can choose different archive views for different taxonomies, but not for categories.

I have 2 product categories:

1) regular diamonds
2) colored diamonds

the regular diamonds need to be in a table.
the colored diamonds in a grid.

thanks!

ido

#406382

Nigel
Supporter

Languages: English (English ) Spanish (EspaƱol )

Timezone: Europe/London (GMT+00:00)

Toolset enables you to customise WordPress archives without code, but it doesn't have the same granular level of control as the native WordPress template hierarchy.

Toolset lets you specify a custom template to use for displaying category archives (for any category), but stops short of the native WordPress ability to use different templates for different categories. (You can see how this works in native WP here: https://developer.wordpress.org/themes/basics/template-hierarchy/#examples.)

So, in Toolset, the same template will be used regardless of the category being viewed.

You can, however, use conditional shortcodes in your custom archive template to output alternate HTML blocks depending on the category being viewed.

You would use conditional shortcodes that looked something like:

[wpv-conditional if="( '[wpv-taxonomy-slug]' eq 'diamonds' )"]
...
[/wpv-conditional]

There is a guide to setting up conditional output here: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

And the reference documentation for the wpv-conditional shortcode is here:
https://toolset.com/documentation/views-shortcodes/#wpv-conditional

Let me know how you get on.