Hook custom query with filter bar

Home Forums Calendar Products Filter Bar Hook custom query with filter bar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1158556
    Kelli
    Participant

    I am working with a custom photo view template. Below the events, I would like to run a custom wp query that links up with the custom taxonomy filter I added to the filter bar.

    Locations is linked up with the Events calendar. I have a query that looks up posts based on the Locations filter.

    It works, if I refresh the screen (F5), but I would like it to refresh with the selection of the Locations in the filter bar, when it is clicked or if I use the submit button.

    Currently I am using a _GET Predefined Variable to find the values of my custom taxonomy parameter to use with my custom query.

    $OurLocations = $_GET[‘tribe_our-location’];
    $TribeOurLocation = implode(‘,’, $OurLocations);
    $args = array(
    ‘post_type’ => ‘post’,
    ‘tax_query’ => array(
    ‘relation’ => ‘AND’,
    array(
    ‘taxonomy’ => ‘our-location’,
    ‘field’ => ‘term_id’,
    ‘terms’ => explode(‘,’, $TribeOurLocation)
    ),
    ),
    );
    $query = new WP_Query( $args );

    What is the hook or function in ECP that I can use, like the filter bar does, to get the custom taxonomy parameter from the url and run the refresh on the whole page that the filter bar runs?

    #1159461
    Jeff Serani
    Member

    Hi Kelli

    First off, I do want to note that we are fairly limited in how much we can support custom development questions like this. At the very least, I’d be happy to at least point you in the right direction, if I can.

    We have a two guides that will be a great place for you to start:

    – Our Themer’s Guide (there is a list within the Events Calendar Pro section for Photo View)
    Functions Archive

    As a helpful point in a potential right direction – it sounds like this is the file you’ll want to review in the Filter Bar plugin if that is what you’re interested in customizing > src/Tribe/Filters/Category.php

    Hopefully this helps you complete that customization!

    Have an excellent weekend!

    #1168315
    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 ‘Hook custom query with filter bar’ is closed to new replies.