I want to show the child category name not the parent category name

Posted by Vhal on Stack Overflow See other posts from Stack Overflow or by Vhal
Published on 2012-09-27T03:36:30Z Indexed on 2012/09/27 3:37 UTC
Read the original article Hit count: 152

Filed under:
|
  <div class="careerleft">

   <?php query_posts('cat=9&paged='.get_query_var('paged')); ?>

   <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

   <div <?php post_class() ?> id="post-<?php the_ID(); ?>">

   <p class="career">"><?php the_title(); ?></p>

   <p>Category: <?php single_cat_title()?></p>

   <p>Date posted:<?php the_time('F j, Y') ?></p>

   </div>

   <?php endwhile; ?>

   <?php else : ?>

  <h2>Not Found</h2>


  <?php endif; ?>


 </div>

I want to show the child category name, but when I used the , it only shows the parent category name. In my categories, the parent category name is "careers", and this category has 3 child category names which are Managerial, IT Related and Accounting. What will be the code to show the child category name?

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about wordpress-loop