• Resolved airdrawndagger

    (@airdrawndagger)


    I have very different needs for my different category archives, and the easiest thing for me would be to just add another archive.php, give it another name and perform the changes in the new php-file. How do I do this? I tried just adding another php-file in my theme’s folder but that was obviously not the way to go. I’m sure this is quite easy but I can’t seem to figure it out!

    This is my wordpress site: https://www.doublepeace.se

Viewing 2 replies - 1 through 2 (of 2 total)
  • Instead of creating a separate file, you can use the is_category() conditional tag. Like this for example:

    <?php if(is_category("rock")): ?>
       <h2>Greatest rock bands</h2>
    <?php endif; ?>

    Hope that helps…

    Thread Starter airdrawndagger

    (@airdrawndagger)

    Actually that would help, so thanks, but I found what I was doing wrong. I needed to add

    <?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    ?>

    at the beginning of my new file.

    But thanks for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Several archive pages, how?’ is closed to new replies.