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

17 lines
349 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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;