Support » Themes and Templates » How to except certain pages from being displayed in the sidebar?

  • Like you already might guess, I wonder how I can hide certain pages, e.g. the disclaimer, in the sidebar.
    I put a link to the disclaimer into the footer and that’s why I don’t want to have a second in my sidebar. I once tried to put the status of that page to “private”, and yeah it disappeared from the sidebar BUT unfortunately the page couldn’t be seen by other people than me…

    Hope you understand my problem!
    Thx for helping me dudes!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I assume you know how to edit theme files, so based on that, look for your sidebar.php file in the theme you’re using.

    Since it is a ‘page’ vs a ‘post’ you’ll be looking for a line that says this:

    wp_list_pages( .... )

    Usually it has other bits and pieces in the parentheses, but you need to find out the ID of your page (disclaimer) and add it into those other bits like this:

    wp_list_pages(' ... &exclude=ID ... ')

    So the ID may be 2 or 27, then it would be exclude=2 or exclude=27

    If you need more reading material on it try this codex page: http://codex.wordpress.org/Template_Tags/wp_list_pages

    Richard

    ah thanks very much! That’s exactly what I was looking for!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to except certain pages from being displayed in the sidebar?’ is closed to new replies.