Last active
December 10, 2015 01:18
-
-
Save robneu/4356894 to your computer and use it in GitHub Desktop.
Add a mobile responsive menu to a Genesis Child Theme - Enqueue JavaScript
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
<?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' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.