Forums

[resolved] Different Sidebar Content for Different Pages? (5 posts)

  1. jaxshores
    Member
    Posted 3 years ago #

    Hi everyone,

    I have searched through the forum and read the sidebar documentation, but I am still unsure how to include different sidebars on different pages. In other words, I have 3 pages that use the page template, and I need to have different content in the sidebars depending on the page.

    I had read Customizing your Sidebar that mentions that you can include different sidebars, but since every page uses the same template, I am unsure how to include different sidebars depending on the page.

    Another idea I had was to have php in the sidebar template that says "If page is the contact page, display the following content. Else if this page is the about page, display this content," and so on.

    Is this possible? Any advice or help on this topic is greatly appreciated. Here is a link to the blog I am working on:

    http://olivares4santarosa.com/wordpress/

    Thanks again,

    Jack

  2. glaze0101
    Member
    Posted 3 years ago #

  3. Otto
    Tech Ninja
    Posted 3 years ago #

    Look closely at the is_page conditional tag:
    http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

  4. jaxshores
    Member
    Posted 3 years ago #

    Thanks guys, exactly what I needed.

  5. Badger123
    Member
    Posted 2 years ago #

    This is pretty much the functionality I need also. I don't know exactly where to put the code in otto's link above though.

    Basically I only want links to child pages of the parent page being displayed to be in the left sidebar.

    Any tips?

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags