Page 1 of 1

Adding Categories to pages

Posted: Mon Sep 12, 2022 12:45 pm
by HowardB
From the documentation I see

<?php
// Check if the user is browsing a category
if ($WHERE_AM_I=='category') {
// Get the category key from the URL
$categoryKey = $url->slug();

// Create the Category-Object
$category = new Category($categoryKey);

// Print the category name
echo $category->name();

// Print the category description
echo $category->description();
}
?>
But wondered where I should add this to the index page

Many thanks

Re: Adding Categories to pages

Posted: Fri Sep 23, 2022 11:38 am
by Edi
What will you do?