Home › Forums › Calendar Products › Events Calendar PRO › Unique Single Page Event looks for different Categories
- This topic has 5 replies, 2 voices, and was last updated 8 years, 7 months ago by
Gina Brooks.
-
AuthorPosts
-
August 15, 2017 at 5:30 pm #1335831
Gina Brooks
ParticipantHey there,
Thanks for the help! I am using event calendar pro to set up multiple pages of event and promotion listings. The short codes are working great, and the lists are broken out onto their proper pages except when you click on any of them to go to their single event info page they all default to the same template, which is making the navigation challenging. For example when you go to a single promotion page it pulls up the default-template.php which I am using for the entertainment section. I want those single info pages to be unique from one another and look different. Is there a way to make unique templates for the single page events based on their category?
Thanks again for the help!
August 16, 2017 at 3:03 pm #1336400Cliff
MemberHi, Gina.
If I’m understanding the situation thoroughly, you should referencer our Themer’s Guide to override /wp-content/plugins/the-events-calendar/src/views/single-event.php, in which you could add your own check via tribe_is_event_category
Please let me know if you have any follow-up questions on this topic.
August 16, 2017 at 4:21 pm #1336470Gina Brooks
ParticipantSo I am working on the single-event.php and the override is working fine but my php skills are a bit rusty and I cant seem to get the check working for me. Below is the code I am using to test out if it is working or not and it seems to just be setting the category to Promotions for all single pages now. Its picking up the one category so I’m assuming its some semantic issue with my bit of coding? Any kind of help would be greatly appreciated! Thanks!!
<?php
$tribe_cat = tribe_is_event_category();
?><?php if($tribe_cat = ‘Promotions’) : ?>
<div>
Do HTML Stuff for just my Promotions category Single Pages
</div><?php else : ?>
<div>
Do HTML Stuff for my all of my other category Single Pages
</div><?php endif; ?>
August 17, 2017 at 3:59 pm #1337091Cliff
MemberMy apologies. In re-reviewing this, tribe_is_event_category() is for detecting if you’re on a page like http://wpshindig.com/events/category/wp-meetups/ (an event category page) so it wasn’t the proper suggestion.
The correct suggestion is tribe_get_event_categories() — here’s an example of it in use: https://github.com/moderntribe/the-events-calendar/blob/4.5.10/src/views/modules/meta/details.php#L128
When coding it, please make sure to account for the possibility of multiple categories being assigned to a single event.
Please let me know how this goes for you.
September 8, 2017 at 9:35 am #1346692Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Unique Single Page Event looks for different Categories’ is closed to new replies.
