Skip to content

Instantly share code, notes, and snippets.

@robneu
Last active December 10, 2015 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save robneu/4356894 to your computer and use it in GitHub Desktop.
Save robneu/4356894 to your computer and use it in GitHub Desktop.
Add a mobile responsive menu to a Genesis Child Theme - Enqueue JavaScript
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_mobile_js' );
/**
* Add a script which depends on jQuery
* to enable a responsive menu toggle.
*
* @author FAT Media
* @link http://youneedfat.com/genesis-responsive-design-menu/
*
*/
if ( ! function_exists( 'prefix_enqueue_mobile_js' ) ) {
function prefix_enqueue_mobile_js() {
wp_enqueue_script( 'prefix-general', get_stylesheet_directory_uri() . '/lib/js/general.js', array( 'jquery' ), '1.0.0' );
}
}
@robneu
Copy link
Author

robneu commented May 12, 2013

We've also put together a tutorial on how to create a Genesis mobile responsive menu in case you need more help getting this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment