Add div after sub-menu ul

Add code in header.php
	$args = array(
	   'theme_location'  => 'Header',
	   'container_class' => 'menu',
	   'container_id'    => 'menu-container',
	   'menu_id'         => 'menu-main',
	   'items_wrap'      => '<ul id="%1$s">%3$s</ul>',
	   'walker'          => new Walker_Page_Custom
	);
	wp_nav_menu( $args );

Add code in functions.php
	
	class Walker_Page_Custom extends Walker_Nav_Menu {
		function start_lvl(&$output, $depth) {
			$indent = str_repeat("\t", $depth);
			$output .= "\n$indent<ul class='sub-menu'><div class='menu-ul-div'>\n";
			/* Note: div with class menu-ul-div will be added after sub-menu ul */
		}

		function end_lvl(&$output, $depth) {
			$indent = str_repeat("\t", $depth);
			$output .= "$indent</div></ul><!--flare -->\n";
		}
	}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s