treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] WordPress Single Custom Post-type Taxonomy Template

  • Hi

    I'm pretty familiar with the WordPress template hierarchy, but have a (fairly simple) question about custom post-types...

    I want to create a different single view (single.php) template for a custom post-type taxonomy. I already know that I can create a template page single-$post-type.php and have done so. But I'd like to create a template single-$post-type-$taxonomy.php

    Is this doable?

    To elaborate:

    • I have a custom post-type "products"
    • I then have custom post-type taxonomies: "bricks", "tiles" and "cladding"
    • I already have different archive views for different taxonomy terms (e.g. taxonomy-product_types-tiles.php)
    • I'd like the single-view for bricks to be different to cladding
    • I'd like to do this by having a different single.php file for each custom post-type taxonomy in the same way as one can have a different archive-$taxonomy-$term.php
    • I'd like something like single-product_types-tiles.php

    Help?

    Or am I being dumb and this is just taxomony-$term.php ?

    Thanks in advance.

  • I'd like something like single-product_types-tiles.php

    So, how you do that? Plese, help!