• Hello !
    I am trying to get a DIFFERENT Category php template to show when I add this code, BUT for some reason, its not working for me,

    The “else” seems to work , meaning : when I run this code , ALL the other pages show my “Category.php”

    BUT my PROBLEM is the cat “762” ALSO shows the single1.php ??

    Can someone tell me what I am doing wrong PLEASE ?? ( with sugar and cherries )

    I am trying to apply the following: ( This is placed in my Category.php )

    <?php
    $post = $wp_query->post;
    if ( in_category('3') ) {
    include(TEMPLATEPATH . '/Category-3.php');
    } else {
    include(TEMPLATEPATH . '/Category.php');
    }
    ?>

    ANY help all all would be great ??
    Ths!

Viewing 2 replies - 1 through 2 (of 2 total)
  • What you’re trying to do is already built-in. Read up on Category_Templates in the codex.

    Or am I misunderstanding what you really want? If so, more details please.

    Thread Starter spider110

    (@spider110)

    I want a different category show different templates
    category_templates inside said, you can use the following code

    <?php
    $post = $wp_query->post;
    if ( in_category('3') ) {
    include(TEMPLATEPATH . '/Category-3.php');
    } else {
    include(TEMPLATEPATH . '/Category.php');
    }
    ?>

    but for some reason, its not working for me,
    meaning:when I run this code , ALL the other pages show my “Category.php”

    my meaning :How can I use the above code, before we can call a Category-3.php
    Or, have other ways to make different category pages, show different templates

    PS: I speak English to the not so good! ^_^

    Ths!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘About Category judgement on the template’ is closed to new replies.