• Mark L

    (@marklimmagegmailcom)


    The theme activates with no menus. When I try to set up a menu, most of the pages appear as top level pages instead of obeying the parent page settings. One or two appear in the list of pages as correctly under their parents. When I select pages to add to the menu, they are all added as top level pages even if they are displayed as under a parent in the list of pages.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Mark L

    (@marklimmagegmailcom)

    There is some advice here regarding the same question from 4 years ago with much older version (3.1).

    IS the solution still valid?

    Thread Starter Mark L

    (@marklimmagegmailcom)

    I have 6 parent pages each with 3 or 4 child pages each that each have 3 or 4 child pages themselves. Some of these pages have the same title. I understand how to create child pages manually, but these relationships are already described in the page metadata and other themes seem to be able to generate a default menu from this data successfully.

    Is there any way of achieving that sort of menu creation here?

    The link you posted was about how to display them in hierarchical way in Appearance -> Menu -> Pages. And it’s already so in wordpress.
    What you want is that when you select X pages (and their children) and click Add to Menu, the hierarchy is respected in Menu Structure.
    Which other theme does this?
    Probably other themes gives you an option to dynamically create menus respecting pages/categories hierarchy, but not from Appearance -> Menu.
    Customizr uses wp_nav_menu (and a custom walker) to grab/display menus created in Appearance -> Menu.
    So to answer to your question:
    “Is there any way of achieving that sort of menu creation here?”
    Not by default, not without creating a function yourself, not without changing core files OR using a child theme + removing an action (see hooks) + adding your action with the function above as callback.
    ??

    Thread Starter Mark L

    (@marklimmagegmailcom)

    Thanks for the detailed answer. You are absolutely right. Is there a way to use the wp_page_menu as a default if no menus are defined in Appearance __> Menu by adding it into the fallback_cb array in class-menu-header.php?

    Well yes, but you cannot use the customizr nav walker then. So you have to style the menu on your own, anyway… create a child theme and add this to its functions.php:

    add_filter( 'tc_menu_args', 'my_menu_args');
    function my_menu_args( $args ){
        $args['fallback_cb'] = 'wp_page_menu';
        $args['walker'] = '';
        return $args;
    }

    Hope this helps

    Thread Starter Mark L

    (@marklimmagegmailcom)

    Thanks d4z_c0nf, your help was useful and greatly appreciated.

    You’re welcome.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘menu does not detect parent pages’ is closed to new replies.