Home › Forums › Calendar Products › Events Calendar PRO › Category Pages – unique html content
- This topic has 5 replies, 4 voices, and was last updated 9 years, 9 months ago by
CTC.
-
AuthorPosts
-
June 23, 2016 at 1:05 pm #1131177
CTC
ParticipantHello,
In the display tab of settings, I put some custom html to be displayed before the events content. It looks great.
I’m wondering, however, if I can change this HTML in the pages that are generated from categories. For example, /events/category/architecture/.
Can I add custom HTML JUST for this and other category page(s)?
Thank you in advance and thank you for all of your support thus far.
-Ben
June 24, 2016 at 5:21 am #1131425Nico
MemberHey Ben,
Thanks for reaching out to us on this!
What you describe sounds possible with the help of a code snippet, but surely not doable from the Event Settings. If you use a snippet for this the content for the category pages will be ‘hardcoded’ into the snippet, this means you won’t be able to edit it like you do with the default html field. Do you think this solutions works for you anyway?
Please let me know about it,
Best,
NicoJune 24, 2016 at 6:05 am #1131439CTC
ParticipantHi Nico,
Thank you for the response. Yes, the code snipped option sounds ideal. The question is, can I create unique HTML content for EACH category page. So, one code snipped for the ‘architecture’ category page, another for the ‘online’ category page, etc.
Is this possilbe? And if so, where do I place these code snippets?
Thank you,
BenJune 27, 2016 at 2:14 pm #1132607Nico
MemberThanks for confirming Ben!
Place the following snippet in the functions.php file of your theme (or child theme):
// Tribe show specific content for cats
function category_tribe_events_before_html ( $before ){if ( tribe_is_event_category() ) {
$cat = get_queried_object();
if ( 'architecture' == $cat->slug ) {
$before = 'Custom before text for architecture cat';
} else if ( 'online' == $cat->slug ) {
$before = 'Custom before text for online cat';
}
}return $before;
}add_filter( 'tribe_events_before_html', 'category_tribe_events_before_html' );
Give a try and let me know if it works for you,
Best,
NicoJuly 12, 2016 at 9:35 am #1138721Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Category Pages – unique html content’ is closed to new replies.
