Skip Navigation

[Resolved] Conditional logic – show texts based on taxonomy and field

This support ticket is created 5 years, 11 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 3 voices.

Last updated by josephC-2 5 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1172905

Tell us what you are trying to do?
I want to show Text1 if taxonomy-location alone is shown. Text2 if taxonomy-location AND field_practice-area2 is selected. Text3 if taxonomy-location AND field_practice-area3 is selected and so on. Only one of text1 or text2 or text3 should be visible.
like text4 if location is chandigarh and practice are is family law.

Is there any documentation that you are following?
NO

Is there a similar example that we can see?

What is the link to your site?

(please hide url link)

#1172911

Hello,

I suggest you try with [wpv-conditional] shortcode, check if the current post has term and check the custom fields value, then display what you want, see our document:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific
Checking if a post has a specific term assigned

https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/
Checking Types Fields and Custom Fields

#1172929

Let me re-phrase the question - that way I will show I cant get the answer from documentation.

I want text1 to appear only when url shows "aaa" and "bbb" in url.
like
my-domain.com/aaa+...._+_...._+_...._bbb -> shows text1

Can this be done with shortcode?

#1172935

There isn't such a built-in feature within shortcode [wpv-conditional] shortcode or Toolset plugins, it needs custom codes, for example, you can create a custom a custom shortcode, in this shortcode PHP function do these:
1) Get the URL of current page:
hidden link
'REQUEST_URI'
The URI which was given in order to access this page;

2) Check if there is "aaa" and "bbb" in the URL string
hidden link

Then output the "text 1" as you want.

And I have modified your post to remove your website URL

#1172941

Hi, are you able to help me with the following i am way behind on my schedule - https://toolset.com/forums/topic/deleting-old-files-to-create-a-fresh-install-of-toolsets/

thanks in advance