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
// Make an element in the page go full width | |
// Author: Bill Erickson | |
// URL: http://www.billerickson.net/code/full-width-element-middle-page/ | |
function explodeWidth() { | |
var browserWidth = $(document).width(); | |
var wrapWidth = $('.site-inner .wrap').width(); | |
var margin = ( ( browserWidth - wrapWidth ) / 2 ); | |
$('.explode-width').css( 'margin-left', - margin ).css( 'margin-right', - margin ); | |
} |
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
// Set equal height columns, for background color | |
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
$('.main-col, .sub-col').setAllToMaxHeight() |
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
$is-ie8: false !default; | |
// Compass cross-browser support configuration | |
$legacy-support-for-ie6: false; | |
$legacy-support-for-ie7: false; | |
$legacy-support-for-ie8: true; | |
// Susy settings | |
// ------------------------------------------------ |
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
/* | |
* Adds classes to the `<label>` element based on the type of form element the label belongs | |
* to. This allows theme devs to style specifically for certain labels (think, icons). | |
*/ | |
jQuery( '#container input, #container textarea, #container select' ).each( | |
function() { | |
var sg_input_type = 'input'; | |
var sg_input_id = jQuery( this ).attr( 'id' ); |
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
define('WP_DEBUG', true); | |
/** | |
* When debug mode is enabled, you can enable logging to store errors in wp-content/debug.log | |
* This is useful for finding errors that might not get displayed on screen | |
* | |
* The next conditional section will make sure errors are not shown to users when logging is enabled | |
* This helps with quick troubleshooting on live sites | |
*/ | |
define('WP_DEBUG_LOG', true); |
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 | |
if( stristr( $_SERVER['SERVER_NAME'], "dev" ) ) { | |
// Dev Environment | |
define( 'DB_NAME', 'project_dev' ); | |
define( 'DB_USER', 'project_dev_user' ); | |
define( 'DB_PASSWORD', 'password' ); | |
define( 'DB_HOST', 'localhost' ); | |
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
// hide plugins in admin | |
add_filter( 'all_plugins', 'hide_plugins'); | |
function hide_plugins($plugins) | |
{ | |
// Hide hello dolly plugin | |
if(is_plugin_active('hello.php')) { | |
unset( $plugins['hello.php'] ); | |
} | |
// Hide disqus plugin |
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 theme switching by hiding theme item - for all except admin (id 1) | |
add_action( ‘admin_init’, ‘slt_lock_theme’ ); | |
function slt_lock_theme() { | |
global $submenu, $userdata; | |
get_currentuserinfo(); | |
if ( $userdata->ID != 1 ) { | |
unset( $submenu['themes.php'][5] ); | |
unset( $submenu['themes.php'][15] ); | |
} | |
} |
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
add_filter( 'plugin_action_links', 'disable_plugin_deactivation', 10, 4 ); | |
function disable_plugin_deactivation( $actions, $plugin_file, $plugin_data, $context ) { | |
// Remove edit link for all | |
if ( array_key_exists( 'edit', $actions ) ) | |
unset( $actions['edit'] ); | |
// Remove deactivate link for crucial plugins | |
if ( array_key_exists( 'deactivate', $actions ) && in_array( $plugin_file, array( | |
'akismet/akismet.php', | |
'better-author-bio/better-author-bio.php' | |
))) |
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
/* | |
check in IE, might need ":" instead of "::" | |
HTML: <p class="tooltip">Some text</p> | |
*/ | |
/* tooltip element with border */ | |
.tooltip { | |
position:relative; | |
padding:15px; | |
margin:1em 0 3em; |
NewerOlder