Do you want to list all of the Sub-Categories i.e Child Categories from the Current Category in WordPress Theme? Then you came to the right planet.
Here:
We have posted the simple code snippets that will help you to display all of the subcategories lists from the current post’s parent category. Just follow the below guide.
Read also: How to Retrieve the Slug of Current Page in WordPress?, Remove Menu item Link in WordPress – Not Clickable
Let’s not waste time and let’s get started.
Get Child Category from Parent category in WordPress
Below we have embedded the code snippets that will show you the all of the subcategories lists as unordered list. Just copy the code and paste it into your WordPress Theme’s single.php page.
After that, save and refresh the page to see changes.
Code for Getting subcategories of current category
That’s it.
All the above code is tested, so you don’t need to worry about the issues of displaying child categories.
Video Guide: WordPress get child categories of current category
Hope the above code works very well for you. If you got any error or opinion or have the opinion about this post, let us know in a below comment box. Also, do share this guide on social media website.
What about if I am using a custom post type and custome taxonomy?