WordPress.org

Forums

How to associate a category with a template? (9 posts)

  1. Dabbler
    Member
    Posted 10 years ago #

    I need to have a different look for my Photo category entries. What template is the default for individual entries pages and how do I associate a customized template with that category. In other words I only want photo entries to appear on a photo category page and no where else.

    Thanks for any suggestions.

  2. Root
    Member
    Posted 10 years ago #

    Category or archive.php

  3. Dabbler
    Member
    Posted 10 years ago #

    After further reading, I think I meant how do I associate a customized vesion of single.php with a single category, like photos for display of individual photos? So photo-single.php always gets used for category x, but no other categories are displayed with photo-single.php, they would still use single.php?

    Thanks.

  4. moshu
    Member
    Posted 10 years ago #

  5. Dabbler
    Member
    Posted 10 years ago #

    Thanks but the category templates documentation says nothing about the single.php and how to customize it to appear for only one category of entries.

  6. Root
    Member
    Posted 10 years ago #

    You may need some php if / else hackery like this . Or something similar. A search here might get you started.

  7. TechGnome
    Moderator
    Posted 10 years ago #

    if you have a template filed called category-12.php Then that template will be used when viewing category ID 12... But if you mean for a SINGLE post that is within a specific category, I'm not sure.....

    Tg

  8. Dabbler
    Member
    Posted 10 years ago #

    I guess I'm going through MT withdrawal, they have administration form where you associate a template file with a category and voila, you're done.

  9. Kafkaesqui

    Posted 10 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic