title: wordpress show sub categories in parent category
body: <p>I can see there is already a lot of information on this, but I can't seem to find anything up to date and just wondered if someone can help me.</p>
  
  <p>I have different parent categories and sub-categories, for example:</p>
  
  <p>Web Hosting</p>
  
  <ul>
  <li>Reviews</li>
  <li>Coupons</li>
  </ul>
  
  <p>Domain Registrars</p>
  
  <ul>
  <li>Top registrars</li>
  <li>Discount Codes</li>
  </ul>
  
  <p>I am using the following code in the category.php page and it displays the sub-categories in each category fine:</p>
  
  <pre><code>&lt;?php 
  if ( is_category() ) {
  $this_category = get_category($cat);
  if($this_category-&gt;category_parent):
  else:
  $this_category = wp_list_categories('orderby=id&amp;depth=5&amp;show_count=0&amp;title_li=&amp;use_desc_for_title=1&amp;child_of='.$this_category-&gt;cat_ID."&amp;echo=0");
  echo '&lt;ul&gt;'. $this_category . '&lt;/ul&gt;';
  endif;
  } 
  ?&gt;
  </code></pre>
  
  <p>But when I click on a sub-category link it displays all the posts in that sub-category fine, but then there are obviously no links back to the parent directory etc.</p>
  
  <p>Is there anyway of doing this? Does anyone have some code for me that doesn't have any bugs? Thanks a lot.</p>