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 custom_excerpt($limit = 55, $more = false){ | |
// from wp_trim_excerpt() in /wp-includes/formatting.php | |
$text = get_the_content(''); | |
$text = strip_shortcodes( $text ); | |
$text = apply_filters('the_content', $text); | |
$text = str_replace(']]>', ']]>', $text); | |
// wp already has a trim function | |
$text = wp_trim_words($text, $limit, ''); // pass an empty string in as $more, so we can define our own |
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
// Extracts the video ID from a youtube URL | |
function get_youtube_id($url){ | |
// share URL | |
if( strstr($url, 'youtu.be/') ){ | |
$id = str_replace('http://youtu.be/', '', $url); | |
}else{ | |
// full youtube URL | |
$query_string = array(); | |
parse_str(parse_url($url, PHP_URL_QUERY), $query_string); | |
$id = $query_string["v"]; |
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
img { | |
width: auto\9; | |
height: auto; | |
max-width: 100%; | |
max-width: none\9; | |
vertical-align: middle; | |
border: 0; | |
-ms-interpolation-mode: bicubic; | |
} |
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
///// In your .htaccess: ///// | |
RewriteRule ^login$ wp/wp-login.php | |
///// In your functions file: ///// | |
function wplogin_filter( $url, $path, $orig_scheme ) { | |
// The logout link in the admin bar will does not include a direct. | |
// So, when you hit wp-login.php, the logout is completed and the page does a redirect to itself with 'loggedout=true' appended | |
// This results in a 404 with the new .htaccess rule in place. So, skip this filter on the admin logout link and all is well. |
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
/* | |
Usage: | |
equalizeHeights($('.your-target')); | |
Note: $w = $(window); and breakpoints = {}; defined elsewhere. | |
*/ | |
var equalizeHeights = function($elements){ | |
if( !$elements.length ) return; |