tribe_get_start_date is returning creation date of event, not start date

Home Forums Calendar Products Events Calendar PRO tribe_get_start_date is returning creation date of event, not start date

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32349
    Chris
    Participant

    I’m using the example code from tri.be to check to list the next upcoming event. But when I try to use echo tribe_get_start_date( $post->ID, false, ‘D. M j, Y’ ); to get the event date, it is returning the creation date of the event.

    #32350
    Barry
    Member

    Hey Chris – which example code exactly and where are you using it? If it’s in a template, for instance, can you share the entire code for that template and let me know which template it is?

    (Please don’t post code directly into the forum though! Use a service like Pastebin or Gist.)

    Thanks!

    #32357
    Chris
    Participant

    Hi Barry
    I’ve come to realize that the code is actually returning the current date, not the event creation date. The link on the date does not seem to be working, either.
    I was trying to use the code located at https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events. The pastebin link is http://pastebin.com/kqU1zjs5.

    Any help would be greatly appreciated.

    Thanks
    Chris

    #32372
    Barry
    Member

    So you’re mixing and matching stuff in there.

    Although your initial query using tribe_get_events() looks sound you are then calling setup_postdata() only to iterate through the main WordPress loop (hence tribe_get_start_date() doesn’t have any event data to work with and is returning the current date instead).

    Here is a minimal version of your code with the WP loop functions stripped out.

    #32408
    Chris
    Participant

    Thanks Barry, that plugged my leak! I appreciate your help, especially on a weekend. You guys rock.

    #32409
    Chris
    Participant

    PS–I don’t see that I can do this, but you can close this as solved if you like.

    #32412
    Barry
    Member

    Thanks Chris – I’ll mark it as complete and answered. Have a good one 🙂

    #978587
    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 ‘tribe_get_start_date is returning creation date of event, not start date’ is closed to new replies.