WP Query for Individual Venue

Home Forums Calendar Products Events Calendar PRO WP Query for Individual Venue

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #77866
    Marcus
    Participant

    The Events Calendar Pro already provides the ability to list events by venue, but I have a situation where some venues have their own pages, and I’d like to briefly list the next three events on that page in a sidebar. I’ve been able to do something similar to this regarding categories by using the wp_query like so:
    $wp_query->query(‘posts_per_page=’.$show_posts.
    ‘&post_type=tribe_events’.
    ‘&tribe_events_cat=’.$my_category_slug
    );

    Following suit, I attempted variables like “tribe_events_venue” and “tribe_events_venue_id”, but that didn’t take. I also couldn’t find where parameters like “tribe_events_cat” are currently documented for 3.0.

    In any case, how would I establish a similar query given the ID or slug of the Venue? Thanks for your time and insight.

    #78209
    Chris
    Participant

    It seems the tag you’re looking for is (as opposed to “tribe_events_cat”) is “tribe_venue”

    -Chris

    #78228
    Marcus
    Participant

    Thanks for the suggestion! Perhaps I’m using it wrong, but it seems “tribe_venue” has no affect on the query, whether I use a venue’s slug or its ID like so:

    $wp_query->query(‘posts_per_page=5’.
    ‘&post_type=tribe_events’.
    ‘&tribe_venue=art-studio’
    );

    or:

    $wp_query->query(‘posts_per_page=5’.
    ‘&post_type=tribe_events’.
    ‘&tribe_venue=1384’
    );

    Either query just returns the next five upcoming events regardless of venue, as opposed to just the ones appearing in the “art-studio” venue. Am I doing something wrong here, or is this not the right way to go about it?

    #78394
    Marcus
    Participant

    Okay, I take it this seemingly-simple request is beyond this plug-in’s capabilities. Thanks.

    #78398
    Marcus
    Participant

    In case anyone else is having this problem, I did figure out the solution by dissecting the existing Tribe Events Pro class files. The easiest way to form this query is by using the TribeEventsQuery::getEvents method, documented here:
    http://docs.tri.be/Events-Calendar/class-TribeEventsQuery.html

    Specifically, here’s how I setup the query the above situation:
    $wp_query = TribeEventsQuery::getEvents( array(‘venue’ => 1384, ‘eventDisplay’ => ‘upcoming’, ‘posts_per_page’ => 5 ), true );

    #78657
    Chris
    Participant

    Hi Marcus,
    My apologies for losing track of this ticket. Glad you got it figured out 🙂

    -Chris

    #982424
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘WP Query for Individual Venue’ is closed to new replies.