Conditional if is single and part of the custom taxonomy


I want to write code only if it is single and part of the custom taxonomy. Here’s how my custom taxonomy edit URL looks like:

I tried many different ways but not working. Here’s one example:

if ( is_single() && has_term( ' ', '53' ) )

What’s wrong going on? For the regular category, it’s working with the in_category function. I don’t know how things work for custom taxonomy type. How can I achieve this?

akarim 2 years 2020-12-17T03:10:19-05:00 0 Answers 7 views 0

Leave an answer