WordPress.org

Ready to get started?Download WordPress

Forums

Openstrap
[resolved] Automatic menus? (7 posts)

  1. berthelemy
    Member
    Posted 3 months ago #

    Hi there,

    Rather than having to build a custom menu, I was expecting the main menu (including sub-menus) to be created automatically from the pages and their hierarchy.

    Is that not possible?

    Thanks,

    Mark

  2. stephencottontail
    Member
    Posted 3 months ago #

    There's a Pages widget (Dashboard > Appearance > Widgets) that shows your pages in a hierarchy. You might also consider searching for a plugin.

  3. berthelemy
    Member
    Posted 3 months ago #

    Thanks Stephen,

    I wanted the pages to appear in the main menu space, not as a widget.

    However, I've now found a plugin which automatically adds new sub-pages to a custom menu, so the problem's half solved.

    It's just that most themes, if you don't use a custom menu, will create the menu automatically from the list of pages.

    Cheers,

    Mark

  4. wiefie
    Member
    Posted 3 months ago #

    what is plugin?

  5. berthelemy
    Member
    Posted 3 months ago #

  6. stephencottontail
    Member
    Posted 3 months ago #

    Another option would be to create a child theme, copy over header.php to the child theme, and find these lines:

    <?php wp_nav_menu( array(
    'theme_location' => 'primary',
    'menu_class' => 'nav navbar-nav pull-left',
    'depth' =>4,
    'container' => false,
    'fallback_cb' => false,
    'walker' => new openstrap_theme_navigation()
    ) ); ?>

    Delete the lines 'fallback_cb' => false and 'walker' => new openstrap_theme_navigation() and you'll get the automatic page menu. You would then use CSS to style the resulting menu.

  7. berthelemy
    Member
    Posted 3 months ago #

    Thanks Stephen,

    That's useful.

    Mark

Reply

You must log in to post.

About this Theme

About this Topic

Tags