tribe_get_events inside loop

Home Forums Calendar Products Events Calendar PRO tribe_get_events inside loop

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32487
    Paul
    Participant

    Hello,

    I’m writing a shortcode that shows events from another site in the network, given author, venue and category. I’m using tribe_get_events to grab the events (since I couldn’t get wp_query to filter by venue). The function works perfectly in the sidebar, but in the shortcode, it seems to return the same event multiple times. I’m guessing it’s because the shortcode is already inside the post loop. I do wp_reset_query and wp_reset_postdata, but no luck – the value coming from tribe_get_events is always a repeat.

    Is there a function I can run to get filtered events that’s loop-friendly?

    Thanks!

    #32509
    Barry
    Member

    Hi Paul,

    I’m not sure we can help too much with this one since it sounds fairly custom, but if you want to share your code (please use a service such as Pastebin or Gist rather than posting directly in the forum) then I’d be happy to take a look and see if anything jumps out at me.

    Cheers!

    #32710
    Paul
    Participant

    Thank you, Barry!

    I’m aware it’s very custom and not a feature that would be useful for the average user, but after testing several calendar plugins, we found Modern Tribe’s Event Calendar the most suitable for what we want to achieve (most easily customizable and requiring the least modifications).

    Here’s the gist with the shortcode code:
    https://gist.github.com/leszekr/4958976

    Any help is appreciated. Thank you for your time and great work!

    #32731
    Barry
    Member

    Unfortunately this would take a little too much time to set up and help troubleshoot … so, regrettably, I have to say you’re on your own on this one.

    Sorry we can’t do more on this occasion.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘tribe_get_events inside loop’ is closed to new replies.