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
$my_url = 'http://marcbacon.com/?awesome=true'; | |
$url = esc_url( $my_url ); |
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 to a plugin or functions.php | |
*/ | |
add_filter( 'jpg_quality', 'high_jpg_quality' ); | |
function high_jpg_quality() { | |
return 100; | |
} |
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
// Switch on debugging | |
define('WP_DEBUG', true); | |
// Direct WordPress to the debug log file /wp-content/debug.log file | |
define('WP_DEBUG_LOG', true); | |
// PHP 'display_errors' variable is not forced | |
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
var iScrollPos = 0; | |
$(window).scroll(function () { | |
var iCurScrollPos = $(this).scrollTop(); | |
if (iCurScrollPos > iScrollPos) { | |
//Scrolling Down | |
} else { | |
//Scrolling Up | |
} | |
iScrollPos = iCurScrollPos; |
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
// Place in functions.php or in a plugin | |
function redirection() { | |
if ( ! is_user_logged_in() ) { | |
wp_redirect( '/wp-login.php?redirect_to=' . home_url() ); | |
exit; | |
} | |
} // end function | |
add_action( 'get_header', 'redirection' ); |
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
// Set all carousel items to the same height | |
function carouselNormalization() { | |
window.heights = [], //create empty array to store height values | |
window.tallest; //create variable to make note of the tallest slide | |
function normalizeHeights() { | |
jQuery('.sc_slides .item').each(function() { //add heights to array | |
window.heights.push(jQuery(this).outerHeight()); | |
}); |
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
$('.class').click(function() { | |
//do stuff on click | |
}); |
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
$('.class').hover( | |
function() { | |
//do stuff on hover | |
}, function() { | |
//do stuff after hover | |
} | |
); |
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
// Limit post revisions to 2 | |
define( 'WP_POST_REVISIONS', 2 ); | |
// Save queries | |
define('SAVEQUERIES', true); | |
// Move uploads folder | |
define( 'UPLOADS', 'blog/wp-content/uploads' ); | |
// Disable Cron |
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
//In wp-config.php: | |
define('WP_HOME','http://example.com'); | |
define('WP_SITEURL','http://example.com'); | |
//In functions.php: | |
update_option('siteurl','http://example.com'); | |
update_option('home','http://example.com'); |