Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active October 14, 2015 22:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/2e4c56e7c124a44ad493 to your computer and use it in GitHub Desktop.
Save neilgee/2e4c56e7c124a44ad493 to your computer and use it in GitHub Desktop.
Using Navgoco as Vertical Dropdown Slide Menu WordPress
<?php
//do not copy the opening php tag above
/**
* Using Navgoco as Vertical Dropdown Slide Menu WordPress
*
* @package Navgoco as Vertical Dropdown Menu
* @author Neil Gee
* @link https://wpbeaches.com/using-navgoco-vertical-multi-level-menu-wordpress-genesis-theme/
* @copyright (c) 2014, Neil Gee
*/
//Navgoco Scripts and Styles Registered and Enqueued, scripts first - then styles - added in Fontawesome for the caret
function themprefix_navgoco_scripts_styles() {
wp_register_script ('navgoco', get_stylesheet_directory_uri() .'/js/jquery.navgoco.min.js', array( 'jquery' ),'1',false);
wp_register_script ('navgococookie', get_stylesheet_directory_uri() . '/js/jquery.cookie.min.js', array( 'jquery' ),'1',false);
wp_register_script ('navgococustom', get_stylesheet_directory_uri() . '/js/custom-menu.js', array( 'jquery' ),'1',true);
wp_register_style ('navgococss', get_stylesheet_directory_uri() .'/js/jquery.navgoco.css','', '2.1.0', 'all');
wp_register_style ( 'fontawesome' , '//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css', '' , '4.4.0', 'all' );
wp_enqueue_script( 'navgoco' );
wp_enqueue_script( 'navgococookie' );
wp_enqueue_script( 'navgococustom' );
wp_enqueue_style( 'navgococss' );
wp_enqueue_style( 'fontawesome' );
}
add_action( 'wp_enqueue_scripts', 'themprefix_navgoco_scripts_styles' );
//fire on selected Menu
jQuery(document).ready(function($) {
$('#menu-header-menu-1').navgoco({//swap in your Menu CSS ID
caretHtml: '<i class="vert-menu"></i>',
accordion: true
});
});
/*for the caret - using fontawesome here*/
.vert-menu:after{
font-family: fontawesome;
float: right;
content: "\f0dd";
font-style: normal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment