How to except certain pages from being displayed in the sidebar? (3 posts)

  1. freddredd
    Posted 6 years ago #

    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!

  2. jbbrwcky
    Posted 6 years ago #

    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


  3. freddredd
    Posted 6 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic