• How to make different categories shows that the category of different page!
    I want a different category pages show different templates!
    it’s not the article pages
    I have used this code in category.php

    <?php
    if (is_category('3')) {
       // looking for category 3 posts
       include(TEMPLATEPATH . '/category-3.php');
    } else {
       // put this on every other category post
       include(TEMPLATEPATH . '/archive.php');
    }
    ?>

    But it can not show that category-3.php, always show archive.php.
    If there is any way, how do I operate
    Ths!

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you have a file called category-3.php file in your themes folder then all when you click on the category with ID 3 it will automatically use that template without the need for the above code. Take a look at this page:

    https://codex.www.ads-software.com/Template_Hierarchy#Category_page

    Thread Starter spider110

    (@spider110)

    oh! markdw!
    Ths!
    but when i run it
    it’s not show category-3.php
    But is archive.php
    I want to know that what its read order is?
    why will demonstrate archive.php , but will not be category.php
    and,is this needs to delete arvhive.php

    Moreover I want to ask that if uses category-3.php,
    does not need to revise other places?
    is the naming is category-3.php?

    Thread Starter spider110

    (@spider110)

    NO ,markdw! thanks !
    Just I had discovered the mistake,
    originally was my target classification regards classifies the page, has been good,
    the question had already solved,
    Ths!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to make different categories shows that the category of different page’ is closed to new replies.