Good morning i need help about relationship post list.
I have many posts in my site and some box show posts that are selected with a relationship field.
The relationship show me a list of posts that i can filter via taxonomies / search / post type, but that list have a alphabetical order.
I want to set this order by post_date. Is it possible?
Thanks
Hi @eocweb
You can always modify the query of a relationship field by using the “acf/fields/relationship/query” hook. Please take a look at this page to learn more about it: https://www.advancedcustomfields.com/resources/acf-fields-relationship-query/.
To learn more about ordering a query, please take a look at this page: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters.
I hope this helps 🙂
This does not work. Adding the ‘orderby’ param does not work. Adding what seems to be any other WP_Query arg does seem to work (i.e. the ‘order’ param). Is there any chance at all that the args are being tweaked after the ‘apply_filters’ for this hook?