Home › Forums › Ticket Products › Event Tickets Plus › custom post type name for hooking into single.php
- This topic has 7 replies, 2 voices, and was last updated 10 years, 11 months ago by Barry.
-
AuthorPosts
-
May 14, 2013 at 5:35 am #48435sitesubscribeParticipant
Hi. I have 2 questions:
#1) I’m using Catalyst theme, and I’m trying to add some stuff to the event detail page (single.php) via a hook.
What should I be using to hook onto when using a conditional?
I’ve tried several things along the lines of is_single(‘tribe_events’) and can’t get anything to show up via the hook.
I even tried: if (is_single(‘tribe_events’) || is_single(‘tribe_venue’) || is_single(‘tribe_organizer’))
I’ve tried (with no result):
get_post_type()
is_singular()
post_type_exists(‘tribe_events’)***Please advise what the custom post type name is, and the proper conditional.***
(I’ve done some editing to single.php in the theme/events folder and that works fine, just having trouble with hooks.)
#2) Somewhere either in the video tutorials or the documentation I thought I saw references to widgets:
Events Calendar widget & Next Event widgetThose widgets seem useful, but those widgets aren’t available in my install of WooTickets. It seems perhaps they are only for The Events Calendar Pro.
Is this intentional, or are those widgets just not available yet in current versin of WooTickets?
To get those widgets I don’t need to add The Events Calendar Pro plugin if I already have WooTickets, right?
Thanks,
~JeffMay 14, 2013 at 6:17 am #48437BarryMemberFor the hook, you could try something like:
if (tribe_is_event() and is_single()) { /* Do something */ }
Regarding the widgets – no widgets ship with WooTickets itself – the ones you refer to are indeed generated by Events Calendar PRO.
May 14, 2013 at 6:25 am #48442sitesubscribeParticipantThanks for quick reply.
I get a conditional match on is_single() by itself, but tribe_is_event() by itself is no match on event detail page single.php (thus the combination using ‘and’ won’t work either). Any other ideas?On the widgets, so if I wanted those widgets I would need to add The Events Calendar Pro in addition to WooTickets? That won’t cause a conflict?
If not, what other functionality/features would I gain by adding The Events Calendar Pro in addition to WooTickets?May 14, 2013 at 7:46 am #48446BarryMemberHi sitesubscribe,
I’d need a better picture of what you are doing – it’s possible you are doing this too early in the request – perhaps you can share a snippet via Pastebin?
On the widgets, so if I wanted those widgets I would need to add The Events Calendar Pro in addition to WooTickets? That wonβt cause a conflict? If not, what other functionality/features would I gain by adding The Events Calendar Pro in addition to WooTickets?
Events Calendar PRO does not create any conflicts with WooTickets that I am aware of – and you can see a summary of what it offers over on its product page π
May 14, 2013 at 9:19 am #48452sitesubscribeParticipantAdding that conditional code to a ‘before content’ hook inside Catalyst theme. My goal is to insert some things into the page, specifically the header. It works on other pages/posts & WooCommerce products using similar code, just not Events. I believe it is because the post type reference is not correct.
Events detail page example is here (temp url will expire soon):
http://irfnews.wordpressmash.com/event/irf-executive-seminar-series-roadside-work-zone-safety-costa-rica/May 14, 2013 at 10:11 am #48459BarryMemberThe post type is tribe_events and this is often accessible using the following class constant (though very early on in the request you would need to use a string literal):
TribeEvents::POSTTYPE
I’m afraid I’m not familiar with the Catalyst theme so it is difficult to offer much more advice here beyond suggesting a different strategy (such as using Default Events templates and changing ecp-single-template.php).
May 14, 2013 at 12:59 pm #48488sitesubscribeParticipantWell, I’m getting closer.
is_singular(‘tribe_events’)) is working now, where before I think I had a missing semi colon somewhere or something…dohh!
Now Catalyst is stripping my shortcodes out of hooks on render, but only on event single.php. So I have a couple of options here I can play with (like not using shortcodes just for this page template, or maybe trying ecp-single-template.php like you suggested).
Thanks for your help.
~JeffMay 14, 2013 at 1:42 pm #48492BarryMemberNo problemo, I hope you get there π
-
AuthorPosts
- The topic ‘custom post type name for hooking into single.php’ is closed to new replies.