Home › Forums › Ticket Products › Eventbrite Tickets › Show link to Event on homepage template
- This topic has 7 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
August 12, 2013 at 3:13 am #59918
Daniel Branigan
ParticipantI’m using the tribe_get_events() function to pull the latest event into my homepage template.
Ideally I’d like to simply show a link to the Event page on the Eventbrite website but failing that I could just show the Tickets iframe.
I’ve tried the tribe_eb_event() function in my homepage template within the loop but I get this error:
Fatal error: Using $this when not in object context in /homepages/26/d404544959/htdocs/new/wp-content/plugins/the-events-calendar-eventbrite-tickets/lib/tribe-eventbrite.class.phpAugust 21, 2013 at 3:57 pm #62342Kelly
ParticipantHi, braniganinteractive. Thanks for getting in touch about your issue. I really apologize for the lag in response time.
Let me have this looked at by our team and get back to you. I should be in touch within the next day or so.
Thanks for your continued patience!
August 21, 2013 at 4:28 pm #62352Barry
MemberHi braniganinteractive,
One possibility here would be to loop through your results and use the post ID for each event to retrieve the related Eventbrite ID / test if it indeed exists by using WordPress’s get_post_meta() function (the related meta key is _EventBriteId), so something like this:
$ebID = get_post_meta($eventID, '_EventBriteId');If you get a valid ID string back you could use it to form a URL for the event over on Eventbrite, as they typically follow a reliable and simple pattern:
www.eventbrite.com/event/{event_id}(Where of course {event_id} would be the actual string of numbers.)
Does that help at all?
August 21, 2013 at 11:12 pm #62398Daniel Branigan
ParticipantHi Barry
I’ve tried your suggestion but I’m getting an array returned rather than a string.
This is the code inside my query loop – I’m getting the correct post ID for the event, but not the _EventBriteId.
$event_id = get_the_ID();
$ebID = get_post_meta($event_id, ‘_EventBriteId’);
echo $ebID;August 22, 2013 at 6:29 am #62417Barry
MemberHi braniganinteractive,
So you’ve got a couple of choices there – you could either inspect the array or you could alternatively ask for a single result to be returned by doing something like:
get_post_meta($event_id, '_EventBriteId', true)There’s a great guide to how get_post_meta() works over here: http://codex.wordpress.org/get_post_meta
Does that help at all?
August 23, 2013 at 1:26 am #62557Daniel Branigan
ParticipantThanks Barry, that’s just what I needed. 🙂
August 23, 2013 at 6:43 am #62579Barry
MemberExcellent!
July 7, 2015 at 6:27 am #980308Support 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 ‘Show link to Event on homepage template’ is closed to new replies.
