• Hello everybody…

    I’m driving myself crazy with the following issue, hope you can help me!

    I’m working on a theme for an arts gallery so I decided to make some custom posts types like “Artists”, “Exhibitions”, etc… Under the custom post type of “exhibitions” I’ve created a custom taxonomy called “gallery-exhibitions”. Everything is ok until now. The thing is that I’ve created some categories under “gallery-exhibitions” called “Past Exhibitions”, “Future Exhibitions” and I need these categories to have an specific look, different than the index or category template and I can’t make it. I been looking around like crazy and nothing showed up… I have only seen one tutorial for crating a custom archive page with a query loop to call the post-type but it didn’t work for me.

    Can someone please let me know how to proceed to make this category based template for my category inside this custom taxonomy? I am really worried about this ??

    Thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Not sure if these will work:

    category-{slug}.php (Note: available with Version 2.9)
    category-{ID}.php

    Or you can just use conditional statements on category.php

    You need to use the taxonomy.php template file (and its derivatives); the category.php template file is only for use with the Category taxonomy.

    If you need the archive index for a custom taxonomy, you would use taxonomy-{taxonomy}.php template file. So, if you’ve created a custom taxonomy, gallery-exhibitions, the archive index for this taxonomy would use the taxonomy-gallery-exhibitions.php template file.

    If you need the archive index for terms for your custom taxonomy, you would use taxonomy-{taxonomy}-{term}.php template file. So, if you’ve got a term, future-exhibitions, for your custom taxonomy, the archive index for this term would be taxonomy-gallery-exhibitions-future-exhibitions.php.

    (Note: I’m not sure how hyphenated taxonomy and term slugs will impact the template hierarchy; it shouldn’t, but if you run into problems, you might try using single-word terms for taxonomy and term.)

    More information: Template Hierarchy

    Thread Starter McEnroe

    (@mcenroe)

    Thank you so much Chip! That’s an amazing explanation.

    I will try this now ??

    Thread Starter McEnroe

    (@mcenroe)

    There’s no problem at all with the hyphenated names… It works great.

    Thank’s again!

    Great! Glad you got it working. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Category Template for Custom Post Type’ is closed to new replies.