Adding Categories to pages

Post Reply
HowardB
Ssr. Bludit
Posts: 28
Joined: Sat Jun 04, 2022 1:31 pm
Been thanked: 1 time

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
User avatar
Edi
Site Admin
Posts: 2863
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 21 times
Been thanked: 30 times
Contact:

What will you do?
Post Reply