[resolved] Trouble only showing first level of pages in my sidebar (2 posts)

  1. wpNewbie80
    Posted 7 years ago #

    Hello, I have just started using WordPress so apologies if I take a while to grasp any advice. I have my pages listed via a widget in my sidebar but as some pages have subpages, it doesn't take long for it to look cluttered.

    I am looking to only show the top level pages initially and then show the child pages (if there are any) once a link to a parent page has been clicked.

    I looked in the forums and the codex pages and saw the depth argument for
    wp_list_pages() and I tried this

    <?php wp_list_pages('depth=1&title_li=<h2>' . __('Pages') . '</h2>'); ?> within my sidebar.php

    However, I still see all of my pages. I'm a little lost as when I searched for how to only show the top level, everyone seemed to get it the above to work, so I wondered if I did something wrong?

    Could anyone offer some advice as to how I can get just the top level pages?

    Thank you for your time


  2. wpNewbie80
    Posted 7 years ago #

    I fixed it. my widgeted sidebar was over riding it

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.