Subpages in Menu Editor not Nesting

I am building a website for a public school district. All of our school buildings have common pages with the same name (i.e. Library, Nurse, Attendance, etc) that are nested under their parent building’s page. While trying to update our site navigation, I’ve noticed that for some reason the Menus -> Pages -> View All area is not nesting the building pages under their building and is instead listing them alphabetically.

Pages not nesting

The odd thing is, I have nested pages set up in other areas of the site and they do nest themselves on the list.
Pages that are nesting

Am I missing something? I can’t find anything different about the way I nested the pages that do display properly vs those that don’t. I double checked the nested pages and they have their building listed as their parent.

I find this extremely frustrating. Unless I go in and edit all of the pages under a specific building to force them into the recent list I have no idea which page is which.

  • I do NOT want to add the building name to each page title.
  • These pages are nested 3 levels deep (Schools -> Building Name -> Page Name)

If there isn’t a way to fix the way the list displays, is there maybe a way to add the parent page’s name to the page name? Or another way to build the menus?

3 Answers
3

For those who run into this in the future, the issue was due to pagination and the parent appearing on a different page than the children. Removing pagination from the View All menu fixed the nesting.

There is a ticket opened 7 years ago reporting this bug and it has yet to be resolved. In the comments user danburzo suggests adding the following filter, which corrected the issue for me.

<?php
  add_filter( 'nav_menu_meta_box_object', array( $this, 'disable_pagination_in_menu_meta_box' ) );

  function disable_pagination_in_menu_meta_box($obj) {
    $obj->_default_query = array(
      'posts_per_page' => -1
    );
    return $obj;
  }
?>

Leave a Comment