WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Add a category-specific single.php, is it possible? (5 posts)

  1. bryan868
    Member
    Posted 6 years ago #

    I want to add a file to the template hierarchy. I want to be able to customize the single.php for a specific category.

    For example if my category is "news" and single-news.php exists, you'll hit that before going to single.php.

    Is this doable?

  2. Chris_K
    Member
    Posted 6 years ago #

    Check out this plugin: http://guff.szub.net/2005/07/21/post-templates-by-category/

    I think it'll do what you're after?

  3. bryan868
    Member
    Posted 6 years ago #

    Ah yes! That looks like it'll do it.

    I wonder if it works with 2.3 though because of the category references? Was "get_the_category" deprecated?

  4. Chris_K
    Member
    Posted 6 years ago #

    Category's are still in WP 2.3, so as long as it uses functions and not direct SQL, I'd think it'd be ok?

  5. bryan868
    Member
    Posted 6 years ago #

    Indeed!

Topic Closed

This topic has been closed to new replies.

About this Topic