Show link to Event on homepage template

Home Forums Ticket Products Eventbrite Tickets Show link to Event on homepage template

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #59918
    Daniel Branigan
    Participant

    I’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.php

    #62342
    Kelly
    Participant

    Hi, 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!

    #62352
    Barry
    Member

    Hi 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?

    #62398
    Daniel Branigan
    Participant

    Hi 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;

    #62417
    Barry
    Member

    Hi 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?

    #62557
    Daniel Branigan
    Participant

    Thanks Barry, that’s just what I needed. 🙂

    #62579
    Barry
    Member

    Excellent!

    #980308
    Support Droid
    Keymaster

    This 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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Show link to Event on homepage template’ is closed to new replies.