17 lines
349 B
PHP
17 lines
349 B
PHP
|
<?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;
|