Anyone can help with this please? It's driving me crazy.
I have 2 taxonomies on my website, the built-in categories and one I created called Countries ('country'). I want to order all the posts that lead to custom taxonomy by title and keep the posts that lead to built-in categories in order by date.
I am using the following code, but it gives me posts on both taxonomies ordered by title. What I am doing wrong?
add_action( 'pre_get_posts', 'theme_taxonomy_order' );
function domino_taxonomy_order($query){
if(!$query->is_main_query()) return $query;
if(is_country) $query->set( 'orderby', 'title' );
if(is_country) $query->set( 'order', 'ASC' );
return $query;
}