Skip Navigation

[Resolved] Content template – conditional output if no taxonomy has been selected

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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 1 year ago.

Assisted by: Waqar.

Author
Posts
#2624843

I have searched and searched, this should be easy and I am failing sorry to bother. I just want to have a conditional output if no taxonomy from my custom taxonomy has been selected. Unassigned in a sense. The slug is task-worker. So if no taxonomy has been selected for that taxonomy I want to simply show "Not Yet Assigned"

I need this for several things or would hash out some random workaround. Thank you for the help!

#2624851
Screenshot 2023-07-17 180959.png

[wpv-conditional if="( '[wpv-post-taxonomy type="task-worker" format="name"]' eq '' )"]Not Yet Assigned[/wpv-conditional]

I have tried and tried it works, but it's highlighted as though its wrong. I hate to use it if its not correct then have it break all over. Thanks!

#2624895

Hi,

Thank you for contacting us and I'd be happy to assist.

Your conditional statement is correct and is safe to use. The code highlighter can get confused due to the nested use of double-quotes, but in terms of functionality evaluation won't be affected by that.

If you'd like, you can replace all internal double-quotes with single-quotes, like this:


[wpv-conditional if="( '[wpv-post-taxonomy type='task-worker' format='name']' eq '' )"]Not Yet Assigned[/wpv-conditional]

regards,
Waqar

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.