tell me how to make that search results are sorted by date. it is first necessary to show the latest entries
that’s how it is done here by adding links: http://screenshot.net/jwkeck2
Here’s how your plug-in is displayed: http://screenshot.net/5yrnu7q
Hi @inforesist
Could you please tell me which custom field type was that? ACF has several hooks to modify the query of some custom field types. acf/fields/post_object/query for the post object field, acf/fields/relationship/query for the relationship field, and acf/fields/taxonomy/query for the taxonomy field.
I hope this helps.
Hi @inforesist
In that case, I believe you can do it like this:
function my_relationship_query( $args, $field, $post_id ) {
// only show children of the current post being edited
$args['orderby'] = 'date';
$args['order'] = 'DESC';
// return
return $args;
}
// filter for a specific field based on it's name
add_filter('acf/fields/relationship/query/name=relationship_custom_field_name', 'my_relationship_query', 10, 3);
Where “relationship_custom_field_name” is the name of your custom field. To learn more about the arguments, please take a look at this page: https://codex.wordpress.org/Class_Reference/WP_Query.
Hope this helps.
I have and it is written. but I can not achieve this sort result as a search in WordPress by adding links
https://www.dropbox.com/s/b5x73uaz6s1h3i2/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202016-04-22%2009.41.07.png?dl=0
may include a search by title?
Hi @inforesist
Could you please open a new ticket here: https://support.advancedcustomfields.com/new-ticket, and provide temporary admin credentials in that ticket so we can check the issue you have? Don’t forget to provide the link to this thread in the ticket.
Thanks!