title: Wordpress custom post type, category archives not working
body: <p>I've spent a few hours googling this but had no joy....</p>
  
  <p>url: <a href="http://workflow.wearepixel.co.uk/product/tall-cabinets/" rel="nofollow">http://workflow.wearepixel.co.uk/product/tall-cabinets/</a></p>
  
  <p>I have the custom post type 'product' and a cpt post with the category 'tall-cabinets'. I just need the custom post categories to display on a shared template (such as taxonomy.php)</p>
  
  <p>I've tried all the standard templates, category.php, taxonomy.php, archive.php, category-product.php, taxonomy-product.php, archive-product.php... and god knows how many scripts...</p>
  
  <p>Unfortunately taxonomy-product-tall-cabinets.php won't work either and won't do as I need to have a default template for all cpt categories.</p>
  
  <p>Please can anyone help?</p>
  
  <p>fixed. Add this to functions.php:</p>
  
  <pre><code>add_filter('pre_get_posts', 'query_post_type');
  function query_post_type($query) {
    if(is_category() || is_tag()) {
      $post_type = get_query_var('post_type');
      if($post_type)
          $post_type = $post_type;
      else
          $post_type = array('post','&lt;strong&gt;cpt&lt;/strong&gt;&lt;strong&gt;'); // replace cpt to your custom post type
      $query-&gt;set('post_type',$post_type);
      return $query;
      }
  }
  </code></pre>