• Hi,

    I’m trying to create multiple archive templates for specific categories.

    For example if you are in Category “1” page and you click on “Yearly Archive: 2009” and it uses a customized template “archive-1.php” instead of the default “archive.php”. Is that possible? I used something like this in archive.php:

    <?php
    if(is_category(1)) {
    include (‘archive-1.php’);
    }
    ?>

    Hoping that it would work but unfortunately not… Any ideas?Thanks!
    AD

Viewing 5 replies - 1 through 5 (of 5 total)
  • Perhaps you’re looking for category templates?

    Thread Starter Agent D

    (@agent-d)

    Thanks for your reply. Yes, I did look at the page. But I was hoping to find a way to actually have multiple templates and load them in according to the category ID. I’m using the code above in “category.php” and load custom templates (such as category-1.php, category-2.php) it’s working fine. Is there anyway that you can do the same?

    AD

    I was hoping to find a way to actually have multiple templates and load them in according to the category ID

    That’s how category templates work.

    Thread Starter Agent D

    (@agent-d)

    Hmm.. i see, so with archive page I can’t do that?

    If by “archive pages” you mean date based post listings as opposed to listing by category, no. What is it that you’re trying to do? You originally said that you wanted to create multiple templates for specific categories – in which case the link I gave has the solution.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom archive templates for specific categories?’ is closed to new replies.