How to show the current catorgy and tags for a page - php

Post Reply
Jr. Bludit
Posts: 1
Joined: Sat Nov 17, 2018 9:52 pm

Sat Nov 17, 2018 9:55 pm

How can I show the current catorgy and tags for a page?

I found something like this in the docs:
$items = getCategories();

foreach ($items as $category) {
// Each category is an Category-Object
echo 'Category name: ' . $category->name();

But obviously it will show all categories and just the onces that belong to a page.
User avatar
Master Bludit
Posts: 99
Joined: Wed Jun 07, 2017 1:05 pm

Tue Nov 20, 2018 1:36 pm


Code: Select all

if ($page->tags(true)) {
foreach ($page->tags(true) as $tagKey=>$tagName) {
echo '<li><a href="'.DOMAIN_TAGS.$tagKey.'" rel="tag">'.$tagName.'</a></li>';

Code: Select all

if ($page->category()) {
 echo ' <a href="'.DOMAIN_CATEGORIES.$page->categoryKey().'">'.$page->category().'</a> ';
bludit plugins and themes - makeitblu | I do things, check them out on behance | check out startups undiluted - london's startup ecosystem
Post Reply