x
 
Create New Page
 View Previous Changes    ( Last updated by Phoebe )

Category Child

Question


I want to display the lowest level category for an entry, the opposite of the parent paramter

Answer

(There may be a better way…)

{exp:weblog:entries limit="1"}

{categories}
<?php
$lastcatname
="{category_name}";
?>
{
/categories}

<h1>Category: <?php echo $lastcatname; ?></h1>

...

For this to work, Allow PHP must be turned ON in the Template Preferences and set to OUTPUT.

Category:Tricks Category:Categories

Categories: