Problem:
How to sort archive page using custom field.
Solution:
Query of archive page is already defined by wordpress, it is not possible to modify the sort order within Toolset but by adding custom code to your current theme's functions.php file you can achieve this.
You can use hook "pre_get_posts" to alter the query on fly.
function sort_by_last_name($query) {
if ($query->is_post_type_archive('artist') && $query->is_main_query()) {
$query->set('order', 'DESC');
$query->set('meta_key', 'wpcf-artist-last-name');
$query->set('orderby', 'meta_value');
}
}
add_action('pre_get_posts', 'sort_by_last_name');
We document known issues and their solutions in Toolset errata. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.
Support Policy
Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.
Please make sure to issue only one topic per each support ticket.