Skip to content

Instantly share code, notes, and snippets.

View pdmade's full-sized avatar

Paul Davidson pdmade

View GitHub Profile
@pdmade
pdmade / vanilla-js-cheatsheet.md
Created September 26, 2018 02:24 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@pdmade
pdmade / mobile-menu-dropdown.js
Created June 14, 2016 16:18
jQuery for dropdown menus
//MOBILE SUBMENU
jQuery ( '#site-menu li.menu-item-has-children' ).prepend('<div class="menu-item-has-children"></div>');
jQuery( '#site-menu li.menu-item-has-children' ).on('click', function() {
jQuery(this).toggleClass('rotate open-sesame');
});
jQuery('html').on('click', function() {
//Hide the menus if visible
jQuery('span').removeClass('rotate');
jQuery('ul').removeClass('open-sesame');
});
@pdmade
pdmade / Genesis framework: Load Parent stylesheet after child
Last active November 17, 2015 19:37
Genesis loads the child theme stylesheet very early in the process. This will make sure you child theme's stylesheet loads after the parent theme.
//Don't have Genesis load child theme styles
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
//* Load parent stylesheet first, then load the child stylesheet
add_action( 'wp_enqueue_scripts', 'load_theme_scripts' );
function load_theme_scripts() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), CHILD_THEME_VERSION );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ), CHILD_THEME_VERSION );
}
@pdmade
pdmade / gist:ee64aad6440d5bbb04c5
Last active August 29, 2015 14:21
Add custom favicon to Wordpress header.php
<?php //add custom favicon ?>
<link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.png" />
@pdmade
pdmade / functions.php
Last active August 29, 2015 14:15
Child theme function that loads parent theme stylesheet.
<?php
//load the parent theme stylesheet and then the child theme stylesheet
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
@pdmade
pdmade / style.css
Created February 17, 2015 15:31
twentyfifteen child theme base with meta info
/*
Theme Name: contentJones-child
Template: twentyfifteen
Theme URI: http://www.contentjones.com
Author: Paul Davidson
Author URI: http://www.contentjones.com
Description: This is a child theme of twentyfifteen used for the first incarnation of contentjones.com
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@pdmade
pdmade / style.css
Last active August 29, 2015 14:15
The minimum needed for a twentyfifteen child theme
/*
Theme Name: contentJones-child
Template: twentyfifteen
*/