Support » Fixing WordPress » Menu via shortcode isn't indenting

  • Resolved juliemooster



    I am having an issue with a menu that isn’t indenting on the page when I cut and paste the menu in via shortcode.

    The page that the menu is pasted at is:

    and the menu is meant to look like the one at this page:

    I’ve configured the menu to look like it does in the page in the link just above here from within the Appearance/Menus section, but for some reason it isn’t indenting at all.

    The shortcode I’m using is:
    <?php wp_nav_menu( $defaults ); ?>

    Which has the following code above it, just under the get header tag:
    <?php $defaults = array(
    ‘theme_location’ => ”,
    ‘menu’ => ‘Sub Page Menu’,
    ‘container’ => ‘div’,
    ‘container_class’ => ‘menu-{menu slug}-container’,
    ‘container_id’ => ”,
    ‘menu_class’ => ‘menu’,
    ‘menu_id’ => ”,
    ‘echo’ => true,
    ‘fallback_cb’ => ‘wp_page_menu’,
    ‘before’ => ”,
    ‘after’ => ”,
    ‘link_before’ => ”,
    ‘link_after’ => ”,
    ‘items_wrap’ => ‘<ul id=”%1$s” class=”%2$s”>%3$s’,
    ‘depth’ => 0,
    ‘walker’ => ”
    ); ?>

    I’m sure that this is really obvious as to what I’m doing wrong, but I can’t spot it! Can anybody assist?

    Many thanks in advance.

    Kind regards


Viewing 2 replies - 1 through 2 (of 2 total)
  • Looks like most if not all of your problems are CSS related.

    If you look at the rendered HTML code for the two menus, the one that is not working has an extra div:
    <div class="menu-{menu slug}-container">

    The non-working one also has this CSS code (from indexstyle.css) overriding some of the other styles:

    #menu {
        padding-left: 55px;
        padding-top: 15px;
        text-transform: uppercase;

    They two menus also don’t have the same classes and thus other CSS code is not applied them the same way…

    Don’t know if that helps, but hope so…

    Thank you very much indeed, that has sorted it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Menu via shortcode isn't indenting’ is closed to new replies.