Tags and Taxonomy links not working for Custom Post Types

I had to modify queries before they run. So the best practice was to add the following code to function.php: if (!function_exists(‘my_theme_filter’)) { function my_theme_filter( $query ){ if ( $query->is_main_query() ) if ( $query->get( ‘tag’ ) OR is_search() ) $query->set( ‘post_type’, array( ‘artprim_item’ ) ); //echo ‘<pre>’; print_r($query); echo ‘</pre>’; return $query; }} add_filter( ‘pre_get_posts’, … Read more