The taxonomy template you have (taxonomy-insight_type-academia.php
) is in the form of (taxonomy-{taxonomy}-{term}.php
), and the format for is_tax()
is is_tax( '<taxonomy>', '<term>' )
, so in your pre_get_posts
callback, you should:
// Use this.
if ( $query->is_tax( 'insight_type', 'academia' ) )
// Not this.
if ( $query->is_tax( 'academia', 'insight_type' ) )
Additionally — to avoid conflict with other queries, you should also check if the current query is the main one or not, and also check if it’s an admin-side request.
if ( ! is_admin() && $query->is_main_query()
&& $query->is_tax( 'insight_type', 'academia' )
)
You may already know that, but I thought it’d be a good reminder. 🙂