Custom Template Taxonomy

If I’m understanding your question correctly, you want to avoid code duplication among the three CPT archive and three taxonomy template files?

If the point is primarily one of avoidance of code duplication (i.e. DRY – Don’t Repeat Yourself), I would recommend creating template part files for the loop content for each CPT:

  • content-{cpt1}.php
  • content-{cpt2}.php
  • content-{cpt3}.php

You’ll still need the template files for the CPT archives and the taxonomy indexes:

  • archive-{cpt1}.php
  • taxonomy-{taxonomy1}.php
  • archive-{cpt2}.php
  • taxonomy-{taxonomy2}.php
  • archive-{cpt2}.php
  • taxonomy-{taxonomy2}.php

But then inside each of those files, just replace the loop markup with the appropriate template-part file. For example, archive-{cpt1}.php and taxonomy-{taxonomy1}.php might look like this:

<?php
get_header();

get_template_part( 'content', 'cpt1' );

get_footer();
?>

That’s the most straight-forward method. However, there is a method that uses fewer template and template-part files: filtering template_include (or hooking into template_redirect) to tell WordPress which template file to use.

To start, create three template files, one for each CPT/taxonomy:

  • template-cpt1.php
  • template-cpt2.php
  • template-cpt3.php

(Note that these are full template files – header, content, and footer – and not merely template-part files.)

Then, just tell WordPress when to use them.

For example:

function wpse129011_include_cpt_templates( $template ) {
    // CPT 1 archive index or CPT 1 taxonomy index
    if ( is_post_type_archive( 'cpt1' || is_tax( 'taxonomy1' ) {
        return get_template_directory() . '/template-cpt1.php';
    }     
    // CPT 2 archive index or CPT 2 taxonomy index
    else if ( is_post_type_archive( 'cpt2' || is_tax( 'taxonomy2' ) {
        return get_template_directory() . '/template-cpt2.php';
    }     
    // CPT 3 archive index or CPT 3 taxonomy index
    else if ( is_post_type_archive( 'cpt3' || is_tax( 'taxonomy3' ) {
        return get_template_directory() . '/template-cpt3.php';
    }
    return $template;
}
add_filter( 'template_include', 'wpse129011_include_cpt_templates' );