I’m trying to set the category pages to sort by title in ascending order. I’ve tried adding:
if( $query->is_category() )
$query->set( 'orderby' => 'title', 'order' => 'asc' )
to pinboard_filter_query() but it breaks the page. Any suggestions?
Try 'orderby' => 'post_title'
Thanks Daniel, that breaks as well. I installed a plugin for this feature which does the following:
add_action('pre_get_posts','sort_categories_by_title');
function sort_categories_by_title($x) {
if(is_category()) {
$x->query_vars['orderby'] = 'title';
$x->query_vars['order'] = 'ASC';
}
}
The same code fails in functions.php which suggests that something else is happening there that causes the failure.