Support » Plugins » Hacks » Template for child archive of custom post type

  • Resolved joshdd


    Hello all 🙂

    So I have a custom post type used by a plugin – lets call it CAKE.
    In the archives, there are several sub sections of CAKE – lets call them CUSTARD, CREAM and SAUCE.
    And CUSTARD has 2 sub categorys – lets call them HOT and COLD

    Now when viewing CAKE archive at it uses my custom template file archive-cake.php but when you view any of the sub sections of it, for example CUSTARD at it just uses the standard archive template (archive.php) – how can I get them to use my custom template?

    ADDITIONALLY – in my header.php I’m using if ( is_post_type_archive('cake') ):
    to add a something to the header for cake archive pages, but again the sub-pages of cake such as custard aren’t responding to this.

    I’m working local so can’t provide real links – sorry.

    In summary: uses archive-cake.php but uses archive.php, so how do i get to use archive-cake.php

    And how do I get to respond to is_post_type_archive('cake')


Viewing 2 replies - 1 through 2 (of 2 total)
  • HOOOLD it right there — think I’ve worked it out – I think CUSTARD and all the others are taxonomies – so I need to use is_tax().

    Seems to be working… will mark as resolved when fully tested.


    Yup – that’s all working 🙂 is_tax()

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Template for child archive of custom post type’ is closed to new replies.