Custom Templates For Different Post Categories?

Discussion in 'WordPress' started by richkid, Nov 14, 2009.

  1. #1
    I am currently designing my latest blog theme and am wordering if it is possible to have a different page template for blog categories.

    For example, I have two categories. News, and Information.

    For the posts in the news category, I don't want comments enabled and I don't want an author box. But with the posts in the information category, I do want commends enabled and a author bio box.

    Is there a way to do this with wordpress easily?
     
    richkid, Nov 14, 2009 IP
  2. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please give this a read:

    http://codex.wordpress.org/Category_Templates

    Basically you use the nicename of the category as part of the file name for the template. For news, wordpress is going to look for category-news.php as a template.

    Hope this helps,
    -drmike

    edit: Excuse me. Actually it checks for the ID of the category as part of the file name currently.
     
    theapparatus, Nov 14, 2009 IP
  3. richkid

    richkid Well-Known Member

    Messages:
    1,684
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    140
    #3
    That is exactly what I was looking for! thankyou so much :D
     
    richkid, Nov 14, 2009 IP
    theapparatus likes this.
  4. addlinkurl

    addlinkurl Well-Known Member

    Messages:
    2,409
    Likes Received:
    129
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #4
    for the category templates, yes that one is true(category-ID.php)

    but for the posts in a specific category, you can use this plugin. this plugin lets you to choose different themes for your posts.
     
    addlinkurl, Nov 14, 2009 IP