// jQuery
$(document).ready(function() {
// code
})
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
function debug(){ | |
if (typeof console != "undefined"){ | |
if (console.log){ | |
if (arguments.length == 1){ | |
console.log(arguments[0]); | |
} else { | |
console.log(arguments); | |
} | |
} | |
} |
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
/* disable user selections */ | |
jQuery.fn.disableSelection = function(){ | |
$(this).each(function(){ | |
$(this).attr('unselectable', 'on') | |
.css('-moz-user-select', 'none') | |
.each(function() { | |
this.onselectstart = function() { return false; }; | |
}); | |
}); |
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
To use this: | |
1. check out the gist somewhere | |
2. edit the plist to contain the path to the .rb file | |
3. run this: | |
chmod +x update-webkit.rb | |
launchctl load com.indirect.update-webkit.plist |
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 | |
/** | |
* Adds fav icons to <head> | |
* | |
* @see https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head | |
* @package ThemeName | |
* @uses http://realfavicongenerator.net | |
*/ | |
add_action( 'wp_head', 'child_theme_fav_icon_link' ); | |
function child_theme_fav_icon_link() { ?> |
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
Put Code In Function.php | |
<?php | |
function themeslug_theme_customizer( $wp_customize ) { | |
$wp_customize->add_section( 'themeslug_logo_section' , array( | |
'title' => __( 'Logo', 'themeslug' ), | |
'priority' => 30, | |
'description' => 'Upload a logo to replace the default site name and description in the header', | |
) ); | |
$wp_customize->add_setting( 'themeslug_logo' ); | |
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array( |
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
/** | |
* to exclude field from notification add 'exclude[ID]' option to {all_fields} tag | |
* 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification | |
* see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options | |
* example: {all_fields:exclude[2,3]} | |
* example: {all_fields:include[6]} | |
* example: {all_fields:include[6],exclude[2,3]} | |
*/ | |
add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 ); | |
function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) { |
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 | |
//Deletes all CSS classes and id's, except for those listed in the array below | |
function custom_wp_nav_menu($var) { | |
return is_array($var) ? array_intersect($var, array( | |
//List of allowed menu classes | |
'current_page_item', | |
'current_page_parent', | |
'current_page_ancestor', | |
'first', | |
'last', |
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
(function($) { | |
$('a[href*=#]:not([href=#])').click(function() | |
{ | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
|| location.hostname == this.hostname) | |
{ | |
var target = $(this.hash), | |
headerHeight = $(".primary-header").height() + 5; // Get fixed header height | |
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 | |
/** | |
* A class filled with functions that will never go away upon theme deactivation | |
* | |
* @package WordPress | |
* @subpackage GRD | |
* @version 0.1.0 | |
*/ | |
class GRD_Functions { |