• Hello,
    I’m using the plugin in a website where I have some custom Elementor queries, and I would like to sort/fetch items through a custom query.

    But when I set the query in the Query ID section of the Post Widget, together with other filters in Elementor (e.g. order by, filter by custom type, etc.) seems it’s not working. No changes are applied to the output query.

    Is this intended, or is there a solution/workaround to this issue?

    Thanks
    Nicola

Viewing 1 replies (of 1 total)
  • Plugin Support Dara

    (@dara4)

    Hi nicorsm93 (@nicorsm93),

    Yes, this is possible. If you are using Elementor Pro Query ID, it only applies when the query is handled through the elementor/query/{id} hook. When the filter modifies the query after that, it can look like nothing is applied.

    The filter widget has two different ways to include those queries:

    You can enable “Include Loop Grid Query ID” option in your filter widget under “Query”, which will make the filter automatically respect and integrate the Loop Grid query.

    Or you can use the Filter Query ID system, which lets you fully control the query through the plugin’s hook system. In that case you would use a function similar to Elementor’s Query ID approach:

    Eg:

    add_filter( 'bpfwe/filter_query_args/my_custom_filter', function( $args, $widget ) {
        // Show posts where meta key 'highlight' equals 'yes'.
        $args['meta_query'][] = [
            'key'     => 'highlight',
            'value'   => 'yes',
            'compare' => '=',
        ];
        return $args;
    }, 10, 2 );

    Just make sure to use only one of these approaches per widget, otherwise the query modifications can conflict and override each other.

    Let me know if that helps.

    Regards,
    Dara

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.