Forums › Forums › Search & Filter Pro › S&F – AE Pro Posts Blocks – custom query filter, query not filtering
- This topic has 2 replies, 2 voices, and was last updated 4 years, 11 months ago by Trevor.
-
Anonymous(Private) December 10, 2019 at 1:36 pm #228737
Hi,
I cannot get Search & Filter Pro (S&F) to work with Elementor Pro (Elem) and Anywhere Elementor Pro (AE).
The steps I have took:
* In Elem I’ve create a single page template and added an AE Posts Blocks widget to it. The conditions of the template are set to a specific page.
* In S&F I’ve created a new form, set the post type to posts, set the display results method to custom, entered the correct results URL, checked Ajax, changed the Ajax container to “.ae-post-layout-list” (using a list instead of grid) and added the category widget to the search form UI.
* The S&F shortcode I’ve added above the AE Posts Block widget, the addition to the shortcode ‘action=”filter_next_query”‘ was not working, so I created a custom query filter. I followed the steps explained by Elem and linked S&F to the query ( $query->set(“search_filter_id”, 123); ).Looking at the page I see all categories associated with my posts in a radio button format. I see all posts in the list view. Now when I make different selections I see “.ae-post-layout-list” becoming slightly white transparent for a moment, but nothing is filtering.
So I asume S&F and the query are linked to each other, but something is going wrong.
Hope you can help me.
Thanks
Pim
Anonymous(Private) December 10, 2019 at 2:40 pm #228758I resolved it myself.
The explanation by Elem of the Custom Query Filter using the Query ID is a bit different from the explanation of the AE Posts Blocks Query Filter. Using theirs I managed to get it to work.
function my_super_filter_function($query_args){ $query_args['search_filter_id'] = 123; return $query_args; } add_filter('my_super_filter', 'my_super_filter_function');
-
AuthorPosts