• Resolved Spencer Hill

    (@ws5f3dj7)


    Heya – so I’m working on this site: https://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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Spencer Hill

    (@ws5f3dj7)

    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.

    Thread Starter Spencer Hill

    (@ws5f3dj7)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do you use alternate themes for category pages?’ is closed to new replies.