Title: Custom WP_Query, &#039;after&#039; =&gt; date
Last modified: August 30, 2016

---

# Custom WP_Query, 'after' => date

 *  [Pintolus](https://wordpress.org/support/users/pintolus/)
 * (@pintolus)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-wp_query-after-date/)
 * Im wondering if its possible to only show the posts of the last 10 days with 
   this plugin.
    At the moment im using this WP_Query: … ‘post_type’ => ‘post’ ‘
   meta_query’ => array( array( ‘key’ => ‘_post_like_count’, ‘value’ => ‘0’, ‘compare’
   => ‘>’ ) ), ‘meta_key’ => ‘_post_like_count’, ‘orderby’ => ‘meta_value_num’, ‘
   order’ => ‘DESC’, ‘posts_per_page’ => 10, ‘date_query’ => array( **‘after’ =>
   date(‘Y-m-d’, strtotime(‘-10 days’))**), … It will show me the posts with the
   highes like count of the last 10 days. Thank you very much.
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

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

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-wp_query-after-date/#post-6800194)
 * Hi Pintolus,
    That’s wont be possible with the date_query.
 * Could you use a secondary meta_query for the date.
 *  Thread Starter [Pintolus](https://wordpress.org/support/users/pintolus/)
 * (@pintolus)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-wp_query-after-date/#post-6800256)
 * Any idea on how to do it? This is really important to me because otherwise i 
   cant use the plugin.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/custom-wp_query-after-date/#post-6800274)
 * I don’t have time to actually build the query but I would think it would be similar
   to the Event Listing example on the website.
    [https://connekthq.com/plugins/ajax-load-more/examples/event-listing/](https://connekthq.com/plugins/ajax-load-more/examples/event-listing/)
 * On this example I am only querying for event after today’s date.
    So you should
   be able to query for posts within 10 days of todays date.

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

The topic ‘Custom WP_Query, 'after' => date’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/custom-wp_query-after-date/#post-6800274)
 * Status: not resolved