В
документации ACF есть способ через pre_get_posts. Взял код. Изменил тип постов и мета поле и вставил в functions.php, но сортировка на странице архива все равно по дате.
<?php
function my_pre_get_posts( $query ) {
// do not modify queries in the admin
if( is_admin() ) {
return $query;
}
if( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'post' ) {
$query->set('orderby', 'meta_value');
$query->set('meta_key', 'date_end');
$query->set('order', 'DESC');
}
// return
return $query;
}
add_action('pre_get_posts', 'my_pre_get_posts');
?>