Support » Fixing WordPress » Sidebar different for each section.

  • I am making a fansite for Assassin’s Creed using wordpress. I want a different sidebar for each section.

    So I have a default side for the home page, but then I want a sidebar for each section on the different games. Example:

    I have a sidebar for brotherhood, so every page that has example.com/brotherhood will have the brotherhood sidebar. Same goes for revelations and the others.

    I want to do this without a plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Take a look here:

    http://codex.wordpress.org/Function_Reference/get_sidebar

    Particularly the muti sidebars part.

    I figured another way. Don’t if it is a correct way. I created different sidebar files, such as: sidebar-brotherhood.php, sidebar-revelations.php. Then I created different page templates like brotherhood.php, so I can choose a certain template when I post a page. In each template page I matched the sidebars accordingly, for example in the brothhood.php I put <?php get_sidebar(‘brotherhood’); ?>.

    Is this correct or is the other way (which I don’t get) correct?

    Hi piggsy1992

    Your approach is fine. You can use conditionals as outlined by the Codex in the link given you by equalmark or you can create Page Templates which utilize file includes (as you have done)

    Either method is fine.

    Thank you for confirming that Len. Also thanks to equalmark. You both have been a great help.

    You’re welcome. Good luck with the site.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sidebar different for each section.’ is closed to new replies.