public
Created — forked from /gist:1286065

  • Download Gist
gistfile1.aw
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php
$category = get_the_category();
print_r($category);
$parent = get_cat_name($category[0]->category_parent);
if (!empty($parent)) {
echo $parent;
} else {
echo $category[0]->cat_name;
}
?></h1>
<ul>
<?php
if ( is_category() ) {
$current_cat = get_query_var('cat');
wp_list_categories('hide_empty=&title_li=&child_of='.$current_cat);
}
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.