Forums

[resolved] How to keep subpages from showing on nav bar? (8 posts)

  1. amilabosnae
    Member
    Posted 3 years ago #

    I'm using the WP theme Devart: http://wordpress.org/extend/themes/devart

    My subpages are showing in the nav bar and it looks really messy. How do I change the settings so only parent pages are shown?

    Thanks.

  2. stvwlf
    Member
    Posted 3 years ago #

    under the folder you installed WordPress in, the file should be in /wp-content/themes/devart/header.php

    on line 36 in the theme file header.php you will see this:
    <?php wp_list_pages('title_li='); ?>

    change it to this:
    <?php wp_list_pages('title_li='&depth=1); ?>

    That will display only the top level pages in the Nav

  3. amilabosnae
    Member
    Posted 3 years ago #

    Thank you for answering. I did what you said, but got an error out of it:

    Parse error: syntax error, unexpected '=' in /home/www/amilabosnae.com/wp-content/themes/devart/header.php on line 40

    I tried deleting a '=' or two, but it doesn't work. Any idea what's wrong? My site's adress, as you can see, is http://amilabosnae.com

  4. moshu
    Member
    Posted 3 years ago #

    The single quote is in the wrong place. Try this:

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

  5. amilabosnae
    Member
    Posted 3 years ago #

    Awesome! Thank you so much :D I'm doing a happy little dance just for the nice people at WP forums who helped me fix this!

  6. dublin
    Member
    Posted 3 years ago #

    Yes, thank you! I just tried out this theme and had the same issue with the subpages and your line of code fixed the problem. It really is a nice clean theme. I've been trying forever to find a theme that will do what I need it to do.

  7. mbmoran
    Member
    Posted 2 years ago #

    How about if you want to include subpages as a menu item in the main nav?

    I would only want subpages to show up once you select the parent page on the main nav.

    I hope you can help me with this because I really like the theme but if I can't display a subnave, I may have to find another theme that does support subpages.

  8. eedavidee
    Member
    Posted 2 years ago #

    i used this method to remove the subpges on my fusion theme and it worked! great post

Topic Closed

This topic has been closed to new replies.

About this Topic