Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Nav updates
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmbacon committed Jun 29, 2015
1 parent 0d18951 commit ece733c
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 221 deletions.
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Displays all of the <head> section and everything up till <div id="content">
*
*/
include 'inc/vars.php';
include 'inc/vars.php';
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
Expand Down
203 changes: 102 additions & 101 deletions inc/nav-drop-multi.php
Original file line number Diff line number Diff line change
@@ -1,101 +1,102 @@
<!-- 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>

<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>
</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>
<!-- /.navbar-collapse -->

</nav>


<!-- 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>
<!-- 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>


<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>
</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>


<!-- 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>
Loading

0 comments on commit ece733c

Please sign in to comment.