• Resolved Akram Taghavi-Burris

    (@taghaviburris)


    I am creating a theme where I want several category pages to look alike but not all categories.

    If I style the category.php, then all categories will have these settings.

    If I style an indvidual page, say category-4.php, then only category 4 will have the setting.

    What I want is only for category 4,5,6 to all look alike, is there a way to do this, without having to create 3 template files that are alike, just different category names?

    Please let me know, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Its in the Codex.

    Thread Starter Akram Taghavi-Burris

    (@taghaviburris)

    Thanks for the info.

    I found the solution at: http://codex.wordpress.org/Theme_Development

    In the end I created a category.php page that only has the following in it:

    <?php
    $post = $wp_query->post;
    if ( in_category(‘46,47’) ) {
    include(TEMPLATEPATH . ‘/works.php’);
    } else {
    include(TEMPLATEPATH . ‘/cat.php’);
    }
    ?>

    Then in the works.php I created the look for category 46 and 47, while the cat.php is the generic category page.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Category.php that controls certain categories’ is closed to new replies.