Support » Plugins and Hacks » Hacks » Display different sidebars depending on current page

  • Resolved zaqedc

    (@zaqedc)


    I have a sidebar.php and a second file I created (more or less and exact same except for the title) called sidebar-2.php. In page.php I edited the get_sidebar() bit to look like this:

    <?php if (is_page('405')){ get_sidebar('sidebar-2.php');} else { get_sidebar(); } ?>

    The object being that if a certain page was displaying, a different sidebar would appear. As it stands, when I navigate to the page specified, the normal sidebar just displays all the time.

    I am a complete beginner as far as PHP is concerned so if anyone has an idea of where I’m going wrong I’d appreciate it. thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display different sidebars depending on current page’ is closed to new replies.