Possible to merge these two functions?
Unless I’m missing something, I would think you could just use an OR (||) operator to check if it is_tag() or is_tax(): add_action( ‘pre_get_posts’, ‘sort_conference_by_date’ ); function sort_conference_by_date( $query ) { if ( $query->is_main_query() && !is_admin() ) { if ( $query->is_tag() || $query->is_tax() ) { $query->set(‘orderby’, ‘meta_value’); $query->set(‘meta_key’, ‘start_date’); $query->set(‘order’, ‘DESC’); } } }