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
function resetHeight() { | |
var maxHeight = 0; | |
$(".equal-height").height("auto").each(function(){ | |
maxHeight = $(this).height() > maxHeight ? $(this).height() : maxHeight; | |
}).height(maxHeight); | |
} | |
if (window.innerWidth > 650) { | |
resetHeight(); | |
} |
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
// Page Slug Body Class | |
function add_slug_body_class( $classes ) { | |
global $post; | |
if ( isset( $post ) ) { | |
$classes[] = $post->post_type . '-' . $post->post_name; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class', 'add_slug_body_class' ); |
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
@mixin image-2x($image, $width, $height) { | |
@media (min--moz-device-pixel-ratio: 1.3), | |
(-o-min-device-pixel-ratio: 2.6/2), | |
(-webkit-min-device-pixel-ratio: 1.3), | |
(min-device-pixel-ratio: 1.3), | |
(min-resolution: 1.3dppx) { | |
/* on retina, use image that's scaled by 2 */ | |
background-image: url($image); | |
background-size: $width $height; | |
} |
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
$('a[href^="#"]').on('click', function() { | |
var $target = $(this.hash); | |
if ($target.length && $target.html()!==undefined) { | |
var targetOffset = $target.offset().top -50; | |
$('html, body').animate({scrollTop: targetOffset}, 600); | |
} | |
return false; | |
}); |
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
function short_page_template_body_classes( $classes ){ | |
if( is_page() ){ | |
$template = get_page_template_slug(); // returns an empty string if it's loading the default template (page.php) | |
if( $template === '' ){ | |
$classes[] = 'default-page'; | |
} else { | |
$classes[] = sanitize_html_class( str_replace( '.php', '', $template ) ); | |
} | |
} | |
return $classes; |
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 the filter and function, returning the widget title only if the first character is not "!" | |
add_filter( 'widget_title', 'remove_widget_title' ); | |
function remove_widget_title( $widget_title ) { | |
if ( substr ( $widget_title, 0, 1 ) == '!' ) | |
return; | |
else | |
return ( $widget_title ); | |
} |
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
// Hide admin bar when viewing pages while logged in | |
add_filter('show_admin_bar', '__return_false'); |
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
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) { | |
include( dirname( __FILE__ ) . '/wp-config-local.php' ); | |
} else { | |
define( 'DB_NAME', '' ); | |
define( 'DB_USER', '' ); | |
define( 'DB_PASSWORD', '' ); | |
define( 'DB_HOST', '127.0.0.1' ); | |
define( 'DB_CHARSET', 'utf8' ); | |
define( 'DB_COLLATE', '' ); | |
} |
OlderNewer