Looking for support? You can access the support system via your account.
- This topic has 9 replies, 2 voices, and was last updated 3 years, 12 months ago by .
The topic ‘Not filtering – custom query option’ is closed to new replies.
Looking for support? You can access the support system via your account.
Forums › Forums › Search & Filter Pro › Not filtering – custom query option
Hi –
I just purchased and haven’t been able to get it working yet. Filter is for a custom post type which I’v selected. I added my taxonomy terms as checkboxes. For Display I chose the custom option – because the theme I’m using has a custom wpbakery module to query / display custom post type on page. I tried the custom option:
$args = array(‘post_type’ => ‘tour-date’);
$args[‘search_filter_id’] = 98;
$query = new WP_Query($args);
And added the correct url to page. My filter fields show up with shortcode. But when I try to filter the page – the ajax runs but never filters anything. I even tried turning off the ajax option but it did not filter.
How can I get it working / thoughts?
Thanks in advance!
Where did you enter these arguments? In the custom module settings?
Maybe, instead, add a shortcode or text module before the post module, with this shortcode:
[searchandfilter id="98" action="filter_next_query"]
That MIGHT work.
The ‘No Results Found’ type of message comes from the theme or Page Builder, and not our plugin. In the case of the module you are using from Page Builder, they are not often built in to the code, unfortunately.
If the form does not have a text search box, then you can minimize the risk of needing it by following the steps in this post:
https://support.searchandfilter.com/forums/topic/adding-product-tag-search/#post-236003
Is it OK to close this thread for now?
Hi Trevor,
I reached out to plugin author and they provided the below and it’s working now. Thanks and you can close this ticket!
add_action('wp_footer', function() {
?>
<script>
jQuery(document).ready(function($) {
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
console.log("ajax complete");
$("[class*=bne-panel-trigger-]:not(.trigger-page-link)").each( function( i, obj ) {
$(this).on('click', function(e) {
e.preventDefault();
var panelId = $(this).prop('class').match(/bne-panel-trigger-([0-9]+)/)[1];
BNEPanelTrigger( 'open', panelId );
});
});
});
});
</script>
<?php
}, 99);
Thanks for sharing. I will close this thread for now.
The topic ‘Not filtering – custom query option’ is closed to new replies.
© 2024 Search & Filter Support. All Rights Reserved.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy