Home › Forums › Calendar Products › Filter Bar › Hook custom query with filter bar
- This topic has 3 replies, 4 voices, and was last updated 9 years, 7 months ago by
Kelli.
-
AuthorPosts
-
August 31, 2016 at 9:44 pm #1158556
Kelli
ParticipantI 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?
September 2, 2016 at 11:54 am #1159461Jeff Serani
MemberHi 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 ArchiveAs 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.phpHopefully this helps you complete that customization!
Have an excellent weekend!
September 24, 2016 at 9:35 am #1168315Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Hook custom query with filter bar’ is closed to new replies.
