Support » Fixing WordPress » Can I rotate Sidebars depending on the post catagory?

  • actionbasic


    Hi all. I’m looking for a way to rotate a few different sidebars depending on what category the post being read is in. Here is my site:

    as you can see the right sidebar is always the same no matter where you go in the site. Trying to get around that and have relevant info pulled in. I basically want to create a few “right sidebars” and have the ability to call the proper one for the post category. Is there an easy bit of code for this? or a plugin?

    Thanks in advance. Brandon

Viewing 2 replies - 1 through 2 (of 2 total)
  • Dgold


    I know of 2 ways, that you need to choose before you start on this tweak.

    (1) You make 1 giant sidebar.php with a bunch of Conditional Tags. You will need to study conditionals in the Codex to see how, it is explained there. Basically your sidebar would be,
    if category=1
    if category=2

    (2) Or you can use Category Templates. Look it up in the codex, it’s pretty easy. Basically you just copy category.php and make:
    and, I think,

    then in category-1.php, change the sidebar call to sidebar-1.php

    and so on

    Hope this helps you find a direction to start making your sidebars



    that helped quit a bit! thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I rotate Sidebars depending on the post catagory?’ is closed to new replies.