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);
Read more here:: Link To Child Category For A Post