WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Template for child archive of custom post type (3 posts)

  1. joshdd
    Member
    Posted 11 months ago #

    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 http://www.mywebsite.co.uk/cake it uses my custom template file archive-cake.php but when you view any of the sub sections of it, for example CUSTARD at http://www.mywebsite.co.uk/cake/custard 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:
    http://www.mywebsite.co.uk/cake uses archive-cake.php but http://www.mywebsite.co.uk/cake/custard uses archive.php, so how do i get http://www.mywebsite.co.uk/cake/custard to use archive-cake.php

    And how do I get http://www.mywebsite.co.uk/cake/custard to respond to is_post_type_archive('cake')

    Thanks,
    Josh.

  2. joshdd
    Member
    Posted 11 months ago #

    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.

    Josh.

  3. joshdd
    Member
    Posted 11 months ago #

    Yup - that's all working :) is_tax()

Reply

You must log in to post.

About this Topic