Correct code for hiding sub-pages in the sidebar? (2 posts)

  1. worldsnapper
    Posted 5 years ago #


    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...


  2. ClaytonJames
    Posted 5 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic