I have the WP Jb manager plugin which I believe is just a custom post type for jobs. I have enabled categories created some categories.
I need to just show the children of each category instead of the whole list of categories.
I have the following code:
<?php
$terms = get_terms( 'job_listing_category', 'orderby=count&hide_empty=0' );
$count = count($terms);
if ( $count > 0 ){
echo "<ul>";
foreach ( $terms as $term ) {
echo "<li>" . $term->name . "</li>";
}
echo "</ul>";
}
?>
Which outputs a list of all categories (parent and children) as so:
- Office
- Warehouse
- Manufacturing
- Industrial
- Construction
- Building Services Engineers
The parent categories are the bold ones: Office, Industrial and Construction. I want to take one of them and display the children of that category only.
For example: get_category('industrial', 'children_of')
(I know that's not the correct syntax), so it would result in showing the children only of the industrial category:
- Warehouse
- Manufacturing
I can't seem to find a way to do this - Could anyone help?