Check if Current Category has Children

Posted by Prem Tiwari | Updated on

There may or may not be a better way to do this, but here’s how I would do it:

If current taxonomy term has children the get_terms function will return an array, otherwise it will return false. Tested and works on my local vanilla install with Custom Post Type UI plugin used for CPT generation.

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

Related Questions & Answers