In this article we will show you how you can display subcategories by using specific category parent.Please check below code.Assume my parent category id is 23, so i want to display all subcategories under 23(parent category) id.
$subcategories = get_categories(‘&child_of=23&hide_empty=0′); // Here i am passing my id 23 then i am getting results as array.
foreach ($subcategories as $subcategory) { echo $subcategory->name.’
’; } // By using foreach loop we can show subcategories like this.
Enjoy a day.