jQuery click to open menus

<script type="text/javascript">
jQuery(document).ready(function(){
frCurrentOpenMenuId = false;
jQuery('#mobile-nav a[href="#"]').click(function(event){
var parent = jQuery(this).parent().attr('id');
if(frCurrentOpenMenuId == parent){
jQuery('#' + parent).removeClass('submenu-open');
frCurrentOpenMenuId = false;
}
else{
jQuery('.menu-item-has-children').removeClass('submenu-open');
jQuery('#' + parent).addClass('submenu-open');
frCurrentOpenMenuId = parent;
event.preventDefault();
event.stopPropagation();
}
});
jQuery(document).click(function(){ jQuery('.menu-item-has-children').removeClass('submenu-open'); frCurrentOpenMenuId = false; });
});
</script>

Add item to WordPress menu

<?php

function hyp_add_menu_item($items,$args){
if($args->theme_location == 'primary'){
$items .= '<li><a href="http://hyperspatial.com">hyperspatial.com</a></li>';
}
return $items;
}
add_filter('wp_nav_menu_items','hyp_add_menu_item',10,2);

?>

Add Admin Bar Items

<?php

/* Rating Menu Item */
function psra_admin_bar_render(){
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
'parent' => 'ps_admin_menu', // use 'false' for a root menu, or pass the ID of the parent menu
'id' => 'psra_ratings', // link ID, defaults to a sanitized title value
'title' => __('Ratings'), // link title
'href' => admin_url('edit.php?post_type=ps_rating'), // name of file
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
));
$wp_admin_bar->add_menu( array(
'parent' => 'ps_admin_menu', // use 'false' for a root menu, or pass the ID of the parent menu
'id' => 'psra_new_rating', // link ID, defaults to a sanitized title value
'title' => __('New Rating'), // link title
'href' => 'http://provensystems.com/blog/ps-new-rating/', // name of file
'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
));
}

add_action('wp_before_admin_bar_render','psra_admin_bar_render');

?>

Admin bar on bottom

<?php
function admin_bar_on_bottom() { ?>
<style type="text/css">
body {
margin-top: -28px;
padding-bottom: 28px;
}
body.admin-bar #wphead {
padding-top: 0;
}
body.admin-bar #footer {
padding-bottom: 28px;
}
#wpadminbar {
top: auto !important;
bottom: 0;
}
#wpadminbar .quicklinks .menupop ul {
bottom: 28px;
}
</style>
<?php }
add_action( 'wp_head', 'admin_bar_on_bottom' );
add_action( 'admin_head', 'admin_bar_on_bottom' );
?>

Nav menu fallback

<?php

ter_navbar('header');

//Nav Bar - Fallback = Pass false to hide navbar when menu does not exist
function ter_navbar($location = 'primary',$fallback = true){
if(!has_nav_menu($location) && $fallback == false) return;
?>
<nav id="<?php echo $location ?>-nav" class="navigation" role="navigation">
<?php wp_nav_menu(array('theme_location' => $location)) ?>
</nav>
<?php
}
?>