Conditional if is single and part of the custom taxonomy

Question

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:

http://example.com/wp-admin/term.php?taxonomy=us_pf_category&tag_ID=53&post_type=us_p

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?

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

Leave an answer

Browse
Browse