events list with filter by venue in custom template

Home Forums Calendar Products Filter Bar events list with filter by venue in custom template

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1289350
    Sean
    Participant

    I used below reference and got events list, But we need to display particular city events.

    https://theeventscalendar.com/knowledgebase/custom-event-list-pagination/

    We tried below solution but not got the answer,

    $upcoming = new WP_Query( array(
    ‘post_type’ => Tribe__Events__Main::POSTTYPE,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘_VenueCity’,
    ‘value’ => ‘Frankfurt’,
    ‘compare’ => ‘=’,
    )
    ),
    ‘paged’ => $paged
    ) );

    #1290489
    Jennifer
    Keymaster

    Hi Sean,

    Thanks for reaching out! I’d be happy to help you with this.

    I think the issue here is that the IDs for venues are associated with events, but you will first need to query the venues to get only those located in Frankfurt, and then pass those venue IDs as an array to meta_query.

    Try replacing the code you have here with this snippet:

    https://gist.github.com/jentheo/1be5502370030a3d52061e3e751a5f4c

    Note: I assume you have defined $paged somewhere outside of the query, but if not, make sure to do that so you don’t get an error.

    Let me know how that works for you!

    #1300588
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘events list with filter by venue in custom template’ is closed to new replies.