This is some code that I have mixed together from around the web, what I am wanting it to do is show the sub-categories of what ever category it is in.
It seems to work on category, and sub-categories but wont show in the post its self.
<?php
if (is_category()) {
?>
<div id="bodywrap">
<div id="sub-nav" class="wrap">
<?php
$this_category = get_category($cat);
if($this_category->category_parent){
$this_category = wp_list_categories('orderby=id&title_li=&child_of='.$this_category- >category_parent."&echo=0");
}
else{
$this_category = wp_list_categories('orderby=id&title_li=&child_of='.$this_category- >cat_ID."&echo=0");
}
if ($this_category) {
echo "<ul class=\"subnav\">". $this_category . "</ul>";
echo "</div><div class=\"clearboth\"></div>";
}}
else {
?>
<div id="sub-nav" class="wrap">
<h2 title="<?php bloginfo( 'description', 'display' ); ?>"><?php bloginfo( 'description' ); ?></h2>
</div>
<div class="clearboth"></div>
<div id="bodywrap">
<?php
}
?>