Skip Navigation

[Resolved] How to conditionally display some textes in taxonomy archive template for some terms

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

Problem:
The user would like to add some text to some taxonomy archives for SEO reasons. The text should be conditionally displayed depending on the current archive term.

Solution:
If the texts that you intend to add for SEO reasons, will be added for each term? I mean, if there will be a different text for each borough?
If that's the case, why not use taxonomy term fields, check this article https://toolset.com/documentation/user-guides/views/term-fields/

If you only want to have a condition on one or a few terms, you can use conditional blocks and choose the "Views shortcode", then the archive title, and make it equal to a static value in this format "{taxonomy name} : {term name}". Check this example from my install, where the taxonomy name is "Catégorie" (in French) and the term name is "Auto" http://prntscr.com/un1wkn

Relevant Documentation:
https://toolset.com/documentation/user-guides/views/term-fields/

This support ticket is created 4 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: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by brianC-15 4 years, 2 months ago.

Assisted by: Jamal.

Author
Posts
#1787793

The second problem

On the original page I built for 'Therapists in Islington' there was three paragraphs that you could see 'above' the 'view' where the therapists images appear.
These three paragraphs, and indeed possibly more content on the page is relevant and necessary to further SEO the page for 'Therapists in Islington'

(see image 4)

I thought I could solve the issue by creating a 'condition' using an 'if' block and disply the content ONLY on the 'therapists-in islington' page

So the conditional format would mean that the text you see on the 'Therapists in London 21.2' archive page would only appear on the front end when a client views

hidden link

Of course this will mean me creating up to 30+ conditional blocks, each for the different london 'boroughs' e.g. City of london, Hounslow, Ealing, Islington, Camcen etc.

I tried following the forum topic I found that seemed to cover this here:

https://toolset.com/forums/topic/only-show-templates-grouped-section-if-it-matches-a-specific-taxonomy-term/

However I just couldn't work out what the correct parameter fields were to do this.

Am I on the right lines to solve this issue or would you create the opening paragraphs for each 'London Borough' in another way?

Regards

Brian

#1788869

Hello Brian,

Regarding this question, I would like to ask, if the texts that you intend to add for SEO reasons, will be added for each borough? I mean, if there will be a different text for each borough?
If that's the case, why not use taxonomy term fields, check this article https://toolset.com/documentation/user-guides/views/term-fields/

If you only want to have a condition on one or a few terms, you can use conditional blocks and choose the "Views shortcode", then the archive title, and make it equal to a static value in this format "{taxonomy name} : {term name}". Check this example from my install, where the taxonomy name is "Catégorie" (in French) and the term name is "Auto" hidden link

Please let me know if you would add texts for all London-boroughs or selected ones?

#1793085

My issue is resolved now. Thank you!