Saltar navegación

[Resuelto] Create Archives by Taxonomies selection .

This support ticket is created hace 6 años, 7 meses. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 9 respuestas, tiene 2 mensajes.

Última actualización por Akhil hace 6 años, 6 meses.

Asistido por: Nigel.

Autor
Mensajes
#917338

Hi,. i would like to create archieve and details page individually by taxonomy assign.

example in my directory i have

Automobile
- car
- Van
-SUVs

I want to create separate archieve and detail page for " car , Vans , SUVs "

Any guide on this please, i only have 2015 doc not sure if its still valid

https://toolset.com/2015/07/how-to-group-posts-by-category/

#917354
#917376

I created new view to display tax : directory and Taxonomy term filter : automotive ,

under the loop item, i cant find any custom field .

i must be doing something wrong here.

#917388

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

The WordPress template hierarchy supports different archives for different taxonomy terms (https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/), but Toolset doesn't.

If you create a custom archive for a taxonomy, the same archive is used for all the terms of the taxonomy.

However, you can use wpv-conditional shortcodes to display different content according to which term the archive is currently displaying.

If you want to display something outside the Loop (e.g. at the top of the archive page) the only shortcode which works that identifies the current term is the wpv-archive-title shortcode (https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-archive-title), which you can use in a conditional shortcode (paying close attention to its output format).

Inside the Loop you can use the wpv-post-taxonomy shortcode.

#917391

Hi Yes, i know about the wpv-conditional usage,
its going to make the page coding huge and difficult to manage ,

How if i make the taxonomies separate ? would i able to create archieve for them ? OR

Is this suggestion logic :
1 .disable archive page for "directory" ,
2. snippets to enter custom page url [with views/CT shortcode inside ] direct to taxonomies.
3. manually design the main archieve page .

#917393

I guess the only method now is to create new CPT for each term that require custom archieve design ?

#917400

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

The best option would be to create separate taxonomies and you could then have different archives for each.

Otherwise I'm not sure how you don't end up in a situation where you still need if statements to display certain things if it is the van archive, certain things if it is the SUV archive etc..

An alternative would be to create a View which you insert into the archive before the Loop (and have the Loop itself output nothing). This View would include a taxonomy query filter so that the term was set by the current archive, but then you would still need conditional statements to determine what to output depending on the term.

If it is the Loop section where you want to display different content according to the term, then you could create several different (unassigned) Content Templates, one for the Van Loop Ouput, one for the SUV Loop Output, etc., and then use a conditional shortcode to know whether to include the van template, another to know whether to include the SUV template, etc., so that you don't have a spaghetti of conditional shortcodes.

You could use hierarchical static pages where you could insert different content, including different Views, because you know which term you are designing for when you create the page.

e.g. a parent page /automobiles/ with child pages /automobiles/vans and automobile/suvs etc.

You'd need to avoid a URL-clash with the actual taxonomy archives, and you may want to kill those taxonomy archive pages like so (there is no has_archive option for taxonomies): https://wordpress.stackexchange.com/a/210245/35739

#917451

" The best option would be to create separate taxonomies and you could then have different archives for each "

this is ok for now. but the concern is when i want to let guest add their own listing and many taxonomies popup and confuse them . in cred is there way to hide and show only certain tax ? sorry havent touch cred at all so far.

thanks.

#917525

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

You can conditionally display sections of a form based on what the user has chosen for certain fields (https://toolset.com/documentation/user-guides/cred-conditional-display-engine/), but it only works for custom fields, not taxonomies 🙁

That is a JS solution, and it shouldn't be too hard to write a little jQuery to achieve the same thing, selectively displaying certain inputs based on the choice of other—taxonomy—inputs.

#919169

Thanks. ill re-open the case if needed, cheers