Home › Forums › Calendar Products › Events Calendar PRO › Testing for single event listing
- This topic has 6 replies, 4 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
February 27, 2012 at 7:55 pm #15795
David
MemberHi, I want to test in header.php so see if the page being displayed is a single event listing.
I tried get post type = tribe events but I do not think it worked. All I need to know is if the page is showing a single event listing. How can I test for this?
Thanks.February 27, 2012 at 7:58 pm #15796Rob
MemberHey David. I’m not sure I fully understand the issue, but have you checked out if any of our documentation at https://theeventscalendar.com/support/documentation points you in the right direction here? Let me know if not and I can get a dev to take a look.
February 27, 2012 at 8:13 pm #15805David
MemberHi Rob,
The website I am working with (rubycoastmouterehills.co.nz) has 3 sections visit, business and community. Each section has its own 2nd level menu and colour scheme.
I have listed events from the TEC on 2 wordpress pages by filtering by event category (visit or community). All well so far.
I need to maintain the 2nd level menu and colour scheme when drilling down to the event detail in the event single.php template. I run a number of tests in header.php to work out which section I am in based on custom post types, categories etc.
So I am looking to test to see if the user is going to see a single event listing. If they are I will look to see which page referred them to work out if I should show the visit or community submenus. Some events (prob. most) are actually members of both event categories.
Complicated – yep, sure is …
Cheers, David
PS I did try and test on custom post type being tribe_events but I do not think this worked for me. There must be something I can test for early on that will tell me that this is a single event listing.
February 28, 2012 at 7:30 am #15834Rob
MemberHey David. Excellent; thanks for confirming. While I’m not sure about this myself, I’ve asked our dev Jonah to take a look when he hits the forum later this evening. I’ll have him chime in with any thoughts he may have from there.
February 29, 2012 at 4:42 am #15912David
MemberHey Rob, any joy with an answer to this? All I need to do is to test in the header.php file to see if the post showing is a single event listing eg
http://www.rubycoastmouterehills.co.nz/event/a-touch-of-class/
Is is something like
http://wordpress.org/support/topic/how-to-check-for-custom-post-type-and-if-its-hierarchical
or
http://wordpress.stackexchange.com/questions/6731/if-is-custom-post-type
Is is just testing for a custom post type in wordpress?
Thanks, David
February 29, 2012 at 10:01 am #15931Jonah
ParticipantHey David, perhaps this will help:
if(tribe_is_month()) {
echo 'Calendar Grid';
} else if(tribe_is_event() && !tribe_is_day() && !is_single()) {
echo 'Event List';
} else if(tribe_is_event() && !tribe_is_day() && is_single()) {
echo 'Single Event';
} else if(tribe_is_day()) {
echo 'Single Day';
} else {
the_title();
}
July 5, 2015 at 5:00 pm #975827Support 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 ‘Testing for single event listing’ is closed to new replies.
