• Hi,

    Id like to remove the pages from my sidebar. I have found this piece of code but it doesnt say where to place it. I tried adding it to the sidebar.php and it gave a parse error, i must ahve put it in the wrong place ?? Can anyone help me?

    Exclude Pages from List
    To exclude certain Pages from the list, for instance, Pages with ID numbers 17 and 38, use the exclude argument.

      <?php wp_list_pages(‘exclude=17,38&title_li=<h2>’ . __(‘Pages’) . ‘</h2>’ ); ?>

    Note: Page numbers must be in ascending order (ie : exclude=17,38 and not exclude=38,17).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Not knowing what version of WP or what theme: Was there any reference to wp_list_pages in the sidebar.php before you started editing it?

    If you want to remove ALL pages from your sidebar, just remove that tag.

    Thread Starter flumpet

    (@flumpet)

    Ahh yes thats what i really need to do (remove all pages) and i couldnt work out which one it was. Now i have found it that makes much more sence – thank you! ??

    But what if you don’t want all pages to be deleted from the sidebar?? I’ve tried to paste the code in sidebar.php, but it never showed anything. Where in the code should I paste it? Is it possible that it’s a problem that I’m also running sidebar widget?? I’m using ‘water’ theme
    Please help me. Thanks!
    -Marlies (www.silentflow.com/marlies)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where do i place the code in sidebar to remove pages?’ is closed to new replies.