I have a custom post-type ”property” – I then have custom post-type taxonomies: ”open-homes”, ”features” – I already have different views for different taxonomy terms (e.g. taxonomy-property-category-open-homes.php) – I’d like the single-view for "open-homes" to be different to "features" – I’d like to do this by having a different single.php file for each custom post-type taxonomy – I’d like something like single-property-open-homes.php
I would like to do this because my post is assign in two taxonomy one open-homes and also in features so,i'd like the different view of each taxonomy.
I have tried using this but in this way all 61 taxonomy take this layout.
<?php
$terms = wp_get_post_terms( $post->ID,'property-category' );
foreach($terms as $term)
{
$a=$term->term_id;
}
if($a == 61)
{
get_template_part( 'looptest', get_post_format());
}
else{
get_template_part( 'listing', 'single' );
}
?>
But this is not working because. post is assign in term id 61 and also in 18 but i'd like to when term id is 61 then it's single view different.
Please help to run out of this.
Thanks & Regards.
You can do this by working with the Wordpress template hierarchy (see diagram at link below).
http://codex.wordpress.org/Template_Hierarchy
It looks like in your case you would use "single-open-homes.php" and "single-features.php"
Hope this helps.