Support » Themes and Templates » Unique Post Template For Each Category?

  • Hi there! I am trying to create a post template for post in a certain category. In other words, when a user opens a post’s permalink they get a different layout/template if the post is in a certain category.

    I have already looked at the Category Template page, and it appears that is only for category archives.

    I have considered using a conditional tag, but doing so seems a bit excessive use of code.

    Is there any other solutions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Mark Ratledge

    (@songdogtech)

    Forum Moderator

    This is not what you want from the Category Template doc?:

    So, if you want to make the Category whose ID number is 6 look different from what it is currently (and different from other Category pages), you would want to create a category-6.php file. If you want to make all Category pages look different from other archive pages (such as date and author archives), then you would want to create or modify the category.php file.

    Possibly along with a conditional tag to select a different style sheet for each category?

    Every post has an extra ID attached to it, called category-<yourcategoryname>

    I’m sure you can do something with that.

    Peter

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unique Post Template For Each Category?’ is closed to new replies.