This file contains hidden or 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
jQuery('#element').on('click', function(event) { | |
// if pushState is supported! | |
if (Modernizr.history) { | |
event.preventDefault(); | |
var url_to_load = 'our-work'; | |
history.pushState(url_to_load, '', url_to_load); |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
/*------------------------------------------------------------------- | |
| This will attach an eventHandler to an object even if it is added | |
| to the DOM after doc.ready / .load via ajax etc... | |
|-------------------------------------------------------------------- | |
*/ | |
jQuery( "body" ).on( "event", "element", function() { | |
}); |
This file contains hidden or 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
/** | |
* Custom admin login header link | |
*/ | |
function custom_login_url() { | |
return home_url( '/' ); | |
} | |
add_filter( 'login_headerurl', 'custom_login_url' ); | |
/** | |
* Custom admin login header link alt text |
This file contains hidden or 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 | |
/* Display current template you are using | |
* Add to functions.php | |
*/ | |
add_action('wp_head', 'display_template'); | |
function display_template() { | |
global $template; | |
$filename = basename($template); |
This file contains hidden or 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
//Enable bootstrap drop down menu on hover | |
$(document).ready(function() { | |
$('.nav li.dropdown').hover(function() { | |
$('.nav li.dropdown').removeClass('open'); | |
$(this).addClass('open'); | |
}, function() { | |
$(this).removeClass('open'); |
This file contains hidden or 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
compass create . --bare --sass-dir "assets/stylesheets/sass" --css-dir "assets/stylesheets/css" --javascripts-dir "assets/js" --images-dir "assets/img" |
This file contains hidden or 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
$(document).ready(function(){ | |
$('form input:text, form textarea').each(function(){ | |
$.data(this, 'default', this.value); | |
}).focus(function(){ | |
if ($.data(this, 'default') == this.value) { | |
this.value = ''; | |
} | |
}).blur(function(){ | |
if (this.value === '') { | |
this.value = $.data(this, 'default'); |
This file contains hidden or 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
//Add a single upload field to upload one image. | |
static $has_one = array( | |
'BackgroundImage' => 'Image' | |
); | |
$fields->addFieldToTab('Root.Main', new UploadField('BackgroundImage', 'Background Image'), 'Content'); |
NewerOlder