I've spent a few hours googling this but had no joy....
url: http://workflow.wearepixel.co.uk/product/tall-cabinets/
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)
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...
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.
Please can anyone help?
fixed. Add this to functions.php:
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','<strong>cpt</strong><strong>'); // replace cpt to your custom post type
$query->set('post_type',$post_type);
return $query;
}
}