0
votes

I am creating a custom query based on some selected posts in Elementor pro Posts Widget. below is code. The query is displaying posts correctly in Posts widget but found_posts always shows zero value. Can some body help me.

 function my_fav_by_user($fav_query) {

    $fav_query->set( 'post__in', array(2783,2780,2793,2528,2873, 2477,2892,2890));
    
    _e("Total Posts=".$fav_query->found_posts, 'my-text-domain');

}
add_action( 'elementor/query/my_fav_query3', 'my_fav_by_user' );