Using this code from the codex:
<?php
$category = get_the_category();
if($category[0]){
echo '<a href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>';
}
?>
Codex link: http://codex.wordpress.org/Function_Reference/get_the_category
I am able to display the category the post is in as a link (e.g. Business). However, I don't want to display the parent categories. I only want to display the child categories of a certain parent category.
My category structure is like this: Premium (Parent) > Premium Themes (Child) > Ecommerce (Child), Business (Child), Photography (Child), etc.
So I only want to display the children of the Premium Themes category.
Any help much appreciated.