Title: New Query Feature?
Last modified: October 1, 2022

---

# New Query Feature?

 *  Resolved [LesTexas60](https://wordpress.org/support/users/lestexas60/)
 * (@lestexas60)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/new-query-feature/)
 * I like the concept of adding a filter using the New Query ID. I use this with
   Elementor Post widget all the time to set the Category and the Start and End 
   date so the Posts will auto show. I tried adding the same code to Prime Slider
   but nothing is being filtered. It shows all posts and doesn’t even filter the
   Category. The code below should filter based on the Category bing Cat1 and it
   also checks that the current date is between the start and End date fields, they
   are ACF fields. Any suggestions are appreciated.
 *     ```
       add_action('elementor/query/test33', function($query){ 
       	$query->set('category_name', 'cat1');
           $query->set('orderby', 'title');
           $query->set('order', 'ASC');
           $meta_query[] = [
   
               [
                   'key' => 'start_date',
                   'value' => date('Y.m.d'), //date format set in ACF
                   'compare' => '<=',
                   'type' => 'DATE'
               ],
       		[
                   'key' => 'end_date',
                   'value' => date('Y.m.d'), //date format set in ACF
                   'compare' => '>=',
                   'type' => 'DATE'
               ],
           ];
           $query->set( 'meta_query', $meta_query );
   
       });
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Maudud Hossain](https://wordpress.org/support/users/maudud/)
 * (@maudud)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/new-query-feature/#post-16061829)
 * Hello [@lestexas60](https://wordpress.org/support/users/lestexas60/),
    Thanks
   for your idea. We have already a custom query ID field( [https://prnt.sc/tbbAdBXct0pl](https://prnt.sc/tbbAdBXct0pl)).
   You can filter any item by this query ID.
 * Hope you understand.
 * Regards,
    Maudud Hossain
 *  Thread Starter [LesTexas60](https://wordpress.org/support/users/lestexas60/)
 * (@lestexas60)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/new-query-feature/#post-16062327)
 * I understand you already have the field but my point is, it doesn’t work. I use
   Snippet plugin to create the code for that field and then add the snippet name
   to the Custom Query field. Elementor has the same option in their post widget.
   The code above I added to Post widget and it works but when I add the snippet
   to your plugin, the filter doesn’t work. Do you have any videos or instructions
   about how to use your Custom Query? Maybe just something simple like how would
   I filter by Category using the Custom Query.
 *  Plugin Contributor [Maudud Hossain](https://wordpress.org/support/users/maudud/)
 * (@maudud)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/new-query-feature/#post-16066891)
 * Hello [@lestexas60](https://wordpress.org/support/users/lestexas60/),
    Thanks
   for your suggestions for making a tutorial. We will make a tutorial soon. Our
   Prime Slider hook name is “prime_slider”. Please rename the hook name.
 * Just edit your first line as:
    add_action(‘prime_slider/query/test33’, function(
   $query){
 * Regards
    Maudud Hossain
 *  [Shahidul Islam](https://wordpress.org/support/users/bdkoder/)
 * (@bdkoder)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/new-query-feature/#post-16203087)
 * Hello [@lestexas60](https://wordpress.org/support/users/lestexas60/),
    We wish
   you got the solution, if not you may let us know in our live chat support system
   or in this wp support system.
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘New Query Feature?’ is closed to new replies.

 * ![](https://ps.w.org/bdthemes-prime-slider-lite/assets/icon-256x256.png?rev=3452727)
 * [Prime Slider Addons for Elementor](https://wordpress.org/plugins/bdthemes-prime-slider-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bdthemes-prime-slider-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bdthemes-prime-slider-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/bdthemes-prime-slider-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bdthemes-prime-slider-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bdthemes-prime-slider-lite/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Shahidul Islam](https://wordpress.org/support/users/bdkoder/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/new-query-feature/#post-16203087)
 * Status: resolved