WordPress.org

Support

Support » How-To and Troubleshooting » Correct code for hiding sub-pages in the sidebar?

Correct code for hiding sub-pages in the sidebar?

  • Hi,

    I have found the code which should sovle my problem of only showing top-level pages in on the front page, but not sure how to enter it into the Sidebar code template. I found the line in which it should go, but by pasting it in there I made the sidebar dissapear!

    The code is: ‘sort_column=menu_order&depth=1’

    and it should go in the line: <?php wp_list_pages(‘title_li=<h1>Pages</h1>’); ?>

    Someone suggested this code:
    <?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=<h1>Pages</h1>’); ?>
    but the sub-pages are still vivible under the parent page.

    I am using the Aurora theme…

    Thanks

Viewing 1 replies (of 1 total)
  • On line 48 in sidebar.php. replace this;

    <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>

    with this;

    <?php wp_list_pages('depth=1&title_li=<h2>Pages</h2>' ); ?>

    …and see if that works.

Viewing 1 replies (of 1 total)
  • The topic ‘Correct code for hiding sub-pages in the sidebar?’ is closed to new replies.