• I am trying to use bootstrap and underscores together, i cant seem to get dropdown working. I am using the wp-bootstrap-nightwalker, i think this would insert the dropdown class onto the list items, but it doesnt seem to be doing that as per the bootstrap docs#nav-dropdowns.

    whats wrong here?

    Whats the standard way of styling a list item in a wp menu anyway?

    here is my code

    <nav id="site-navigation" class="main-navigation" role="navigation">
    			<button type="button" class="menu-toggle" data-toggle="collapse" aria-controls="menu" aria-expanded="false"><?php _e( 'Primary Menu', 'little-theme' ); ?></button>
    			<?php
    
    			$defaults = array(
    				'theme_location'  => 'primary',
    				'menu'            => '',
    				'container'       => 'div',
    				'container_class' => 'collapse navbar-collapse',
    				'container_id'    => '',
    				'menu_class'      => 'nav navbar-nav',
    				'menu_id'         => '',
    				'echo'            => true,
    				'fallback_cb'     => 'wp_bootstrap_navwalker::fallback',
    				'before'          => '',
    				'after'           => '',
    				'link_before'     => '',
    				'link_after'      => '',
    				'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>',
    				'depth'           => 0,
    				'walker'          => ''
    			);
    
    			wp_nav_menu( $defaults );
    
    			?>
    
    		</nav>

Viewing 1 replies (of 1 total)
  • Thread Starter qwerteleven

    (@qwerteleven)

    ok so i changed what i had to this:

    <?php
    
    			wp_nav_menu( array(
    				'theme_location'  => 'primary',
    				'menu'            => '',
    				'container'       => 'div',
    				'container_class' => 'collapse navbar-collapse',
    				'container_id'    => '',
    				'menu_class'      => 'nav navbar-nav',
    				'menu_id'         => '',
    				'echo'            => true,
    				'fallback_cb'     => 'wp_bootstrap_navwalker::fallback',
    				'before'          => '',
    				'after'           => '',
    				'link_before'     => '',
    				'link_after'      => '',
    				'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s',
    				'depth'           => 0,
    				'walker'          => new wp_bootstrap_navwalker())
    			);
    
    			?>

    which seems to work, the dropdown works great for child menu items, but it doesnt render grand child menu items.

    heres the menu structure for the above:

    Menu Item 1
    -Child Menu Item 1.1
    –Grand Child Menu Item 1.2

Viewing 1 replies (of 1 total)
  • The topic ‘how to style list items for bootstrap using dropdown’ is closed to new replies.