biofriction-wp-theme/library/check-subcategory.php

17 lines
349 B
PHP
Raw Permalink Normal View History

<?php
/**
* Check if a category is subcategory
*
* @package Biofriction
* @since Biofriction 1.0.0
*/
if ( ! function_exists ( 'is_subcategory' ) ) :
function is_subcategory (){
$cat = get_query_var('cat');
$category = get_category($cat);
$category->parent;
return ( $category->parent == 0 ) ? false : true;
}
endif;