Taxonomy template by post type

If you want to use one file as a “taxonomy” template, but want to style posts differently by post type, I’d advise using an if statement. I’m not sure how far you’re going, but if you’re just changing the loop for example, it would look something like this:

Using this question as reference.

<?php while ( have_posts() ) : the_post();

                if( 'blue' == get_post_type() ){
                    //some custom file, custom-blue.php
                    get_template_part( 'content', 'blue' );
                elseif ( 'red' == get_post_type() ){
                    //some custom file, custom-red.php
                    get_template_part( 'content', 'red' );
                } else {
                    //the default loop file, content-format.php
                    get_template_part( 'content', get_post_format() );
                }

endwhile; ?>

You can write an if statement like this to add classes, wrap certain sections in your template and so on – depends on what you need. In my example, it imagines that you have two custom files, custom-red.php and custom-blue.php and if the post type is neither red or blue, then it defaults to it’s regular functionality. Hope that helps!