WordPress.org

Forums

One template for all child categories? (5 posts)

  1. rrho
    Member
    Posted 9 years ago #

    Hello all,

    I'm trying to build a template that WordPress should use for one specific category and all its child categories. Is there a simple way to get around to this without building either single templates for all the categories or writing extensive conditional queries?

    Any help is appreciated. Thanks!

  2. MichaelH
    Member
    Posted 9 years ago #

    If your Category is 6 couldn't you create a category-6.php template?

    See:
    Category_Templates#What_Template_Displays_a_Particular_Category

  3. rrho
    Member
    Posted 9 years ago #

    Apparently, it's not that simple since this won't work for children of category 6.

  4. MichaelH
    Member
    Posted 9 years ago #

    Sorry missed that. Guess that means you may need to resort to query based template of which I've no experience but you might look at this:

    [[Theme_Development#Query-based_Templates]]

  5. MichaelH
    Member
    Posted 9 years ago #

    Oops for some reason I can't edit that last post; I forgot the problem with links to codex that have a dash...

    Here's the link:
    Query Based Templates

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags