How to create a conditional tag for custom taxonomies in WordPress?

Posted by Prem Tiwari | Updated on

In this example, ‘student’ was a custom post type, and ‘stud_cat’ was the custom taxonomy. Use has_student(null) for the conditional.

How to create a conditional tag for custom taxonomies in WordPress?

Add the below code at the end of your theme’s functions.php file or you can also add the below code inside your site-specific plugin.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers