WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hide child page in top bar (9 posts)

  1. freyd
    Member
    Posted 2 years ago #

    Hello everyone,
    I read so many answers on this topic already but nothing worked for me.
    I want to display 2 levels of pages in my navigation bar (parent and child 1). I opened the post-template.php file, went to the wp_list_pages line modified the depth parameter to depth=2 I even tried different values just in case.

    The child pages (level 2) always show, it is so ugly. I tried exluding them one by one in the child_of' => 0, 'exclude' => '' line, but no result.

    Did I miss a $ somewhere?

    Here is the website if you want to have a look: sballiance.org. (the tab "our members" is the problem).

    Thanks in advance.

  2. Pankaj Pandey
    Member
    Posted 2 years ago #

    try
    <?php wp_list_pages('title_li=&depth=2'); ?>

    It will work for you.

  3. freyd
    Member
    Posted 2 years ago #

    Thanks, I had trouble finding where to paste it, but it works now :)

    However, in another page, I see both the navigation bar on top and the sidebar in the left. Do you know a way for me to delete this sidebar for ever on every page?
    Here is the page: http://sballiance.org/?page_id=460

    Thanks again, I'm new at this and my boss just expects me to do it T_T

  4. Pankaj Pandey
    Member
    Posted 2 years ago #

    go to Appearance then widgets go to page widgets and exclude page id which you dont want to show.

    Thanks

  5. Pankaj Pandey
    Member
    Posted 2 years ago #

    add 195,200,202,208,274,214,212,204 to exclude pages its solve your problem

  6. freyd
    Member
    Posted 2 years ago #

    Thanks Pankaj,
    Actually I just removed the page widget from my widget lists and it works too :)

  7. Pankaj Pandey
    Member
    Posted 2 years ago #

    You Are Welcome... I suggest use any other theme to utilize full benefits of WordPress.

  8. Pankaj Pandey
    Member
    Posted 2 years ago #

    Also I suggest mark this post as resolved.

  9. freyd
    Member
    Posted 2 years ago #

    Thanks a lot, I think from now on I will only add simple articles to my website, no design changes at all :)

Topic Closed

This topic has been closed to new replies.

About this Topic