I'm trying to display a link to just the child category on a Wordpress post. For instance if the category for a post is parent > child I want to show a link to just the child category page.
I'm using code from here: Name of last category level for a post
It works perfectly but just prints the child category, how do I go about making it a link tot he child category?
$allCat = get_the_category(); $lastCat = array_reverse($allCat); echo $lastCat->name;