Support » Fixing WordPress » Hiding children submenu (without css)

  • 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Christine Rondeau

    (@crondeau)

    Volunteer Forum Moderator

    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.

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

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hiding children submenu (without css)’ is closed to new replies.