Forums › Forums › Search & Filter Pro › Split: Does not work with Elementor Pro and Ele Custom Skin loops
- This topic has 46 replies, 3 voices, and was last updated 4 years, 8 months ago by Ross.
-
Ross Moderator(Private) April 13, 2020 at 12:23 pm #239811
Hi Armando
I think I have a solution for your needs 🙂
Basically, you want the post widget integration with S&F to be dynamic?
There is a filter you can use in your functions.php (which we use to attach to the query).
Essentially, we use this to attach S&F to the Elementor query:
add_filter( 'elementor/query/query_args', array($this, 'attach_sf_to_posts'), 10, 2 ); //attach S&F to the query
Which takes 2 params like this:
public function attach_sf_to_posts( $query_args, $widget ) { ... return $query_args; }
So what you could do is, use the same filter, but instead of priority of
10
, give it11
(so it would be fired after S&F did its thing)And then you would check if
$query_args['search_filter_id']
is set, (if it is, then S&F has attached itself to the query args based on the settings in the posts widget) and then, you could do whatever conditional checks you need before updating to the appropriate the ID.Does that make sense?
🙂
Ross Moderator(Private) April 13, 2020 at 12:30 pm #239815In regards to the pagination count issue… you are entirely correct, its because the post meta doesn’t exist within the valid min / max ranges…
You’ll have to assign an appropriate default value to those posts – my approach would be to create a query that looks for posts where the meta key doesn’t exists, and assign a value.
This answer gets you most of the way there:
https://wordpress.stackexchange.com/a/270482But your wp_query, should have a meta query to check if the post meta
not exists
like this example:
https://wordpress.stackexchange.com/a/81831Thanks
-
AuthorPosts