0

I have two functions for query filter:

function my_query_filter_most_views( $query ) {
    $query->set( 'orderby', 'meta_value_num' );
    $query->set( 'meta_key', 'entry_views' );
    
    $query->set( 'order', 'DESC' );
}
add_action( 'elementor/query/custom_filter', 'my_query_filter_most_views' );

function my_query_filter_most_views1( $query ) {
    $tax_query = array(
            array(
                'taxonomy' => 'filter',
                'field'    => 'slug',
                'terms'    => 'trending',
            ),
        );
        $query->set( 'tax_query', $tax_query );
}
add_action( 'elementor/query/custom_filter1', 'my_query_filter_most_views1' );

I want to combine these two functions, query filter as one, through which I want to show posts that have views and also show the posts that may or may not have views but have 'trending' as a term. It is working correctly as separate functions, but I am unable to achieve both when combined.

2
  • You'll have to inquire with the Elementor support team. Elementor is a standalone plugin that takes over the WP editor and not a part of WP. Commented Jun 4 at 20:22
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Jun 4 at 20:22

0

Browse other questions tagged or ask your own question.