Sep
05
If you looking forward checking if a certain category has children or not , simply do this
$categories = get_categories( "parent=$cat_id&hide_empty=0" );
if(empty($categories)) {
// what if has no children
} else {
// what if has children
}
don’t forget replacing $cat_id with the category id you want to check .



Leave Your Own Comment on This Post