Title: Order post objects by date when typing
Last modified: September 1, 2016

---

# Order post objects by date when typing

 *  [igogra](https://wordpress.org/support/users/igogra/)
 * (@igogra)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/order-post-objects-by-date-when-typing/)
 * Hi,
 * I have a post object field and I use the acf/fields/post_object/query hook to
   query the posts ordered by date. This is my function:
 *     ```
       function my_post_object_query($args) {
           $args['orderby'] = 'date';
           $args['order'] = 'DESC';
   
           return $args;
       }
       add_filter('acf/fields/post_object/query', 'my_post_object_query');
       ```
   
 * It works great. When I focus in the post object field it returns the posts ordered
   by date. But if I type something in the post object field they are not ordered
   by date. I would like it returns posts wich contain the string typed but ordered
   by date. Is this possible? How can I do it?
 * Thanks.
 * [https://wordpress.org/plugins/advanced-custom-fields/](https://wordpress.org/plugins/advanced-custom-fields/)

The topic ‘Order post objects by date when typing’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [igogra](https://wordpress.org/support/users/igogra/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/order-post-objects-by-date-when-typing/)
 * Status: not resolved