Forum
Outputting the category name on the Archive page of the Events App
Hi there
Apologies my knowledge of PHP is very weak. What I'm trying to do for the archive.php page (using the Events app) is simply output the category within the H1 tag.
For example: https://www.lovebedfordoffers.co.uk.gridhosted.co.uk/offers/archive.php?cat=entertainment
I'm trying to get it to say 'Entertainment Offers'
The code I'm using is:
<?php
/* --------------------------- POSTS BY CATEGORY --------------------------- */
if (perch_get('cat')) {
echo '<h1>'.perch_events_custom(perch_get('cat'), true).' Offers</h1>';
}
?>
You need
perch_events_category()
Thanks Drew, got it working. For some reason though it's adding H1 tags automatically, the code I've got is:
}
which is working fine on: https://www.lovebedfordoffers.co.uk.gridhosted.co.uk/offers/archive.php?cat=accommodation
However, now I've come to edit the TITLE with the following code:
And you can see the <h1> tags are appearing in the Browser title.
That will be from the default template.
Hi - where do I find the default template so I can remove the <h1> tags?
/perch/apps/perch_events/templates/events
https://docs.grabaperch.com/addons/events/template-tags/