WordPress.org

Ready to get started?Download WordPress

Forums

Hiding children submenu (without css) (3 posts)

  1. tombat
    Member
    Posted 2 years ago #

    Hello wordpressers!

    I've been trying to figure out how to hide the "children" submenu from showing up. I found that setting the depth to 1 (instead of 0) in wp_list_pages is supposed to be the answer.

    I did tried this in the wp-includes/post-template.php-file, to no avail (not sure if this is where I should do this). I also tried exluding the specific child-pages that are showing up using the post-id, in the same file. No luck there, either.

    Could anyone point me in the right direction? Is there even a way to do this without changing core files or 'display:none'?

    Thanks a bunch!

  2. I did tried this in the wp-includes/post-template.php-file, to no avail (not sure if this is where I should do this). I also tried exluding the specific child-pages that are showing up using the post-id, in the same file. No luck there, either.

    That's not where to do that.. Don't edit core files ever.

    The setting that you want is in your theme file.

    Look in your header.php for wp_list_pages

    Otherwise, you could also just go to appearance > menus and create a custom menu if your theme is set up for this.

  3. tombat
    Member
    Posted 2 years ago #

    I've chosen to create a custom-menu and it works like a charm and was way simpler than I expected.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic