This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
cornerstone/inc/nav-drop-multi.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
106 lines (91 sloc)
2.77 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- CSS code from Bootply.com editor --> | |
<style type="text/css"> | |
.marginBottom-0 { | |
margin-bottom: 0; | |
} | |
.dropdown-submenu { | |
position: relative; | |
} | |
.dropdown-submenu>.dropdown-menu { | |
top: 0; | |
left: 100%; | |
margin-top: -6px; | |
margin-left: -1px; | |
-webkit-border-radius: 0 6px 6px 6px; | |
-moz-border-radius: 0 6px 6px 6px; | |
border-radius: 0 6px 6px 6px; | |
} | |
.dropdown-submenu>a:after { | |
display: block; | |
content: " "; | |
float: right; | |
width: 0; | |
height: 0; | |
border-color: transparent; | |
border-style: solid; | |
border-width: 5px 0 5px 5px; | |
border-left-color: #cccccc; | |
margin-top: 5px; | |
margin-right: -10px; | |
} | |
.dropdown-submenu:hover>a:after { | |
border-left-color: #555; | |
} | |
.dropdown-submenu.pull-left { | |
float: none; | |
} | |
.dropdown-submenu.pull-left>.dropdown-menu { | |
left: -100%; | |
margin-left: 10px; | |
-webkit-border-radius: 6px 0 6px 6px; | |
-moz-border-radius: 6px 0 6px 6px; | |
border-radius: 6px 0 6px 6px; | |
} | |
</style> | |
<div id="nav-drop-multi"> | |
<div id="drop-multi-wrapper"> | |
<nav id="drop-multi" class="container"> | |
<nav class="navbar navbar-default" role="navigation"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> | |
<a class="navbar-brand visible-xs" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a> | |
</div> | |
<div class="collapse navbar-collapse" id="navbar-collapse-1"> | |
<?php | |
$locations = get_nav_menu_locations(); | |
$menu_at_primary_location = $locations['primary']; | |
$items = wp_get_nav_menu_items( $menu_at_primary_location ); | |
if(empty($items)){ | |
echo '<ul class="nav navbar-nav"><li><a href="'.home_url().'">Home</a></li></ul>'; | |
} else { | |
$menu = wp_nav_menu( | |
array( | |
'menu_class' => 'nav navbar-nav', | |
'theme_location' => 'primary', /* where in the theme it's assigned */ | |
'container' => false, /* container class */ | |
'fallback_cb' => 'hale_main_nav_fallback', | |
'items_wrap' => '<ul class="%2$s"><li><a href="'.home_url().'">Home</a></li>%3$s</ul>', | |
'walker' => new Drop_Multi_Nav_Walker()/*, | |
'with_search' => true*/ | |
) | |
); | |
} | |
?> | |
</div> | |
</nav> | |
</nav> | |
</div> | |
</div> | |
<!-- JavaScript jQuery code from Bootply.com editor --> | |
<script type='text/javascript'> | |
(function($){ | |
$(document).ready(function(){ | |
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { | |
event.preventDefault(); | |
event.stopPropagation(); | |
$(this).parent().siblings().removeClass('open'); | |
$(this).parent().toggleClass('open'); | |
}); | |
}); | |
})(jQuery); | |
</script> |