title: How to: Custom Category Archive Page for custom post type in wordpress
body: <p>I have created my archive-programs.php in a plugin with the below code:</p>
  
  <pre><code>$this-&gt;loader-&gt;add_filter('template_include', $plugin_public, 'programs_template');
  public function programs_template($template) {
      if (is_post_type_archive('programs')) {
          $theme_files = array('archive-programs.php', 'Anthem/archive-programs.php');
          $exists_in_theme = locate_template($theme_files, false);
          if ($exists_in_theme != '') {
              return $exists_in_theme;
          } else {
              return plugin_dir_path(__FILE__) . 'archive-programs.php';
          }
      }
      return $template;
  }
  </code></pre>
  
  <p>This works as expected(above code) and Im able to layout my programs archive into whatever I want. The problem now is I'm trying to create a page for the archive categories with the below code and it is not working.</p>
  
  <pre><code>$this-&gt;loader-&gt;add_filter('category_template', $plugin_public, 'programs_category_template');
  public function programs_category_template($template) {
      if (is_post_type_archive('programs') &amp;&amp; is_tax()) {
          $theme_files = array('archive-programs-category.php', 'Anthem/archive-programs-category.php');
          $exists_in_theme = locate_template($theme_files, false);
          if ($exists_in_theme != '') {
              return $exists_in_theme;
          } else {
              return plugin_dir_path(__FILE__) . 'archive-programs-category.php';
          }
      }
      return $template;
  }
  </code></pre>
  
  <p>Does anyone know how I could create a template for my Archive Categories. I don't want to manually create a template file for each category. The above code just loads the default Archive Category ptemplate</p>