Skip Navigation

[Closed] conditional tax in archive

This support ticket is created 3 years, 7 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 3 voices.

Last updated by Minesh 3 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1773879

Super simple: conditional in archive

'[wpv-conditional if="( '[wpv-post-type]' eq 'restaurant')"][wpv-post-taxonomy type="restaurant-feature"][/wpv-conditional]'

make'[wpv-conditional if="( '[wpv-post-type]' eq 'restaurant')"]' AND POST HAS THE TAXONOMY TYPE ALCOHOL SHOW THAT INSTEAD OF '[wpv-post-taxonomy type="restaurant-feature"][/wpv-conditional]'

Thank you.

#1774053

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

I am really sorry, but I did not understand what you would like to get. Can you give an example with more details, something like:
- Go to page ...
- Where xxx equals yyy.
- I would like to get zzz.

#1774349
archive tags.png

Hi, Jamal, sorry for that. I'm including tax on archives in a tag format, as in image attached. 'Tap Room restaurant' has tags and the bar 'Library Lounge' does not.

Both bars and restaurants are on the restaurant cpt. 'Bar' and 'Restaurant' are term fields of the tax 'Restaurant Types'.

I would like to say "This archive is for restaurants. The tax to use is 'restaurant-features'. However, if the restaurant post is classified as a 'bar', the tax that shows on the archive should be "restaurant types' > term field 'alcohol'.

'[wpv-conditional if="( '[wpv-post-type]' eq 'restaurant')"][wpv-post-taxonomy type="restaurant-feature"][/wpv-conditional]'

#1777063

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal is busy with some other tasks. I'm stepping in and take care of this ticket. Hope this is OK.

I can understand that you want to display something conditionally but its still not clear.

As I understand - you want to display the term custom field value instead of term name. is this correct? If yes:
-
To display the term custom field, you will require to create a taxonomy view and within the taxonomy view you will require to add the term custom field.

If you can share problem URL and access details that would help me to guide you in the right direction.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1777669
Screen Shot 2020-09-15 at 1.14.24 PM.png
Screen Shot 2020-09-15 at 1.12.08 PM.png
Screen Shot 2020-09-15 at 1.12.51 PM.png

Hi, Minesh. I have taxes with term fields.

I want the archive to display the taxonomy "restaurant-features", and it does. (Image above with Momento Pizza.)

In the case that the post *also* has the taxonomy "alcohol", then it will display the term fields from "alcohol", and NOT the term fields from the tax "restaurant-features." (That's the image with the Library Lounge.)

I hope this makes sense. If not, I will have to revisit next week, at which time I will include all login info. (I'm moving today and tomorrow!)

Thank you so much.

#1778203

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I understand but its better if you can share problem URL and access details and then explain what you want to display exact at what part of the page.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] conditional tax in archive’ is closed to new replies.