Skip to content

Instantly share code, notes, and snippets.

@bradpotter
bradpotter / enqueue fitvids
Last active December 11, 2015 18:19
Enqueue fitvids from https://github.com/davatron5000/FitVids.js | Props to @realFATmedia & @krogsgard
// Add to functions file
add_action('wp_enqueue_scripts', 'child_javascript_files');
function child_javascript_files() {
wp_register_script( 'fitvids', get_stylesheet_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), '1.0', true );
wp_register_script( 'loadfitvids', get_stylesheet_directory_uri() . '/js/load.fitvids.js', array('fitvids'), '1.0', true );
wp_enqueue_script( 'fitvids' );
wp_enqueue_script( 'loadfitvids' );
}
@bradpotter
bradpotter / wp-config
Created February 26, 2013 20:56 — forked from robneu/wp-config
/** Define Gravity Forms License Key */
define("GF_LICENSE_KEY", "YOUR-LICENSE-KEY-HERE");
@bradpotter
bradpotter / functions.php
Last active December 20, 2015 20:08
Register Genesis Menus
// Register Genesis Menus
add_theme_support( 'genesis-menus' , array ( 'primary' => 'Primary Navigation Menu' , 'secondary' => 'Secondary Navigation Menu' , 'mobile' => 'Mobile Navigation Menu' ) );
@bradpotter
bradpotter / functions.php
Last active December 20, 2015 20:09
Add Support for Structural Wraps
// Add Support for Structural Wraps
add_theme_support( 'genesis-structural-wraps', array( 'header', 'menu-mobile', 'menu-primary', 'menu-secondary', 'footer-widgets', 'footer' ) );
@bradpotter
bradpotter / functions.php
Last active December 20, 2015 20:09
Create the Mobile Navigation Menu
add_action( 'genesis_before_header', 'gst_do_mobilenav' );
/**
* Create the Mobile Navigation Menu.
*
* @author Brad Potter
*
* @link http://www.bradpotter.com
*
* Based on code from the StudioPress Genesis Framework 2.0
*/
@bradpotter
bradpotter / functions.php
Last active December 20, 2015 20:19
Add Attributes for Mobile Navigation Menu
add_filter( 'genesis_attr_nav-mobile', 'gst_attributes_nav_mobile' );
/**
* Add Attributes for Mobile Navigation Menu.
*
* @author Brad Potter
*
* @link http://www.bradpotter.com
*
* Based on code from the StudioPress Genesis Framework 2.0
*/
@bradpotter
bradpotter / mobilenav.css
Last active December 20, 2015 20:28
Base CSS for Mobile Navigation
/*
Base properties for Mobile Navigation Menu
---------------------------------------------------------------------------------------------------- */
.nav-mobile {
background-color: #333;
}
.nav-mobile a {
color: #999;
@bradpotter
bradpotter / mobilenav.css
Last active December 20, 2015 20:28
Media Query CSS for Mobile Navigation
/* Mobile Navigation Menu Icon properties */
#mobile-menu-icon {
border-bottom: 1px solid #ddd;
cursor: pointer;
display: block;
padding: 24px 24px;
padding: 2.4rem 2.4rem;
text-align: center;
}
@bradpotter
bradpotter / mobilemenu.js
Last active December 20, 2015 20:28
jQuery script for Mobile Navigation Menu
jQuery(document).ready(function($) {
$("#menu-mobile-navigation").before('<div id="mobile-menu-icon"></div>');
$("#mobile-menu-icon").click(function() {
$(".menu-mobile").slideToggle();
});
});
@bradpotter
bradpotter / functions.php
Last active December 20, 2015 20:28
Enqueue Mobile Menu Script
/**
* Register and Enqueue Mobile Navigation Menu script
*
* @author Brad Potter
*
* @link http://www.bradpotter.com
*/
function gst_mobilemenu_script() {
wp_register_script( 'mobile-menu', get_stylesheet_directory_uri() . '/js/mobilemenu.js', array('jquery'), '1.0.0', false );