Forums

[resolved] How do you use alternate themes for category pages? (4 posts)

  1. Spencer Hill
    Member
    Posted 2 years ago #

    Heya - so I'm working on this site: http://jen-novak-consulting.theportlandco.com

    And the categories are listed there in the middle, and when the user clicks on them it brings up all the articles listed.

    The problem I have, is that when a user clicks on those categories, it should switch the template as well. But I can't seem to accomplish this, can someone help? Thanks!

  2. pbwordp
    Member
    Posted 2 years ago #

  3. Spencer Hill
    Member
    Posted 2 years ago #

    Hey thanks. That's not quiet what I'm looking for. That appears to be using a simple if statement that will only swap content based on the filename.

    When I select categories it navigates to /category/%name% - so I need it to use the secondary template based on whether or not the phrase "category" appears in the URI, but that's assuming I'm writing my own PHP.

    And I'm wondering if there is a WordPress specific way of doing this, preferably without having to write my own PHP.

  4. Spencer Hill
    Member
    Posted 2 years ago #

    I resolved this myself. It turns out that if I create a file called category.php then that styles all the category pages automatically.

    So I took my secondary-template.php and duplicated it, then renamed it to category.php.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.