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 is a handy trick to rotate videos filmed in the wrong orientation (big problem with smartphones) | |
//Use Handbrake Version (0.99 or higher) | |
, --rotate=4 | |
on the Extra Options under Video tab |
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 ?wmode=transparent&rel=0 to the youtube embed src | |
//Before | |
/* | |
<iframe width="560" height="315" src="//www.youtube.com/embed/Grgztdps2Rc" frameborder="0" allowfullscreen></iframe> | |
*/ | |
//After - and it works | |
<iframe width="560" height="315" src="//www.youtube.com/embed/Grgztdps2Rc?wmode=transparent&rel=0" frameborder="0" allowfullscreen></iframe> |
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
$recent = new WP_Query(array( | |
'post_type'=> array( 'testimonial'), | |
'orderby' => 'date', | |
'order'=> 'DESC', | |
'posts_per_page'=> -1, | |
'homeselect'=>$taxon | |
)); | |
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
//Change Title tag from yoast | |
global $wpseo_front; | |
remove_filter( 'wp_title', array( $wpseo_front, 'title' ), 15 ); | |
//Add Custom title tag | |
add_filter( 'wp_title', 'child_loops_title', 10, 3 ); | |
function child_loops_title( $title, $sep, $seplocation ) { | |
$test = ucfirst((get_query_var('state'))); | |
$brand_aa = ucfirst((get_query_var('brands'))); | |
$sep = genesis_get_seo_option( 'doctitle_sep' ) ? genesis_get_seo_option( 'doctitle_sep' ) : '–'; |
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
//Snippet for make bumper screenheight -200px | |
jQuery(function ($) { | |
$('.bumper') .css({'height': ($(window).height()-200)+'px'}); | |
$(window).resize(function(){ | |
$('.bumper') .css({'height': (($(window).height()-200))+'px'}); | |
}); | |
/* You can safely use $ in this code block to reference jQuery */ | |
}); |
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(function ($) { | |
$(document).ready(function(e) { | |
showViewportSize(); | |
}); | |
$(window).resize(function(e) { | |
var windowsize = $(window).height(); | |
$(".home-bottom").toggleClass("tiny",(windowsize < 780)); |
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
//* Remove page title for a specific page (requires HTML5 theme support) | |
//* This requires a custom metabox '_lob_fancy_title' to be added to the page template | |
/** | |
* Create Metaboxes For Page Fancy Title | |
*/ | |
function lob_fancytitle_create_metaboxes( $meta_boxes ) { | |
$meta_boxes[] = array( |
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
//Using safe jquery for Wordpress | |
var directionsDisplay; | |
var directionsService = new google.maps.DirectionsService(); | |
var map; | |
function initialize() { | |
directionsDisplay = new google.maps.DirectionsRenderer(); | |
var myLatlng = new google.maps.LatLng(jQuery( '#stores li' ).data( 'latitude' ), jQuery( '#stores li' ).data( 'longitude' )); |
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 toggle_shorten_string($string, $wordsreturned) | |
/* Returns the first $wordsreturned out of $string. If string | |
contains more words than $wordsreturned, the entire string | |
is returned.*/ | |
{ | |
$retval = $string; // Just in case of a problem | |
$array = explode(".", $string); | |
/* Already short enough, return the whole thing*/ | |
$c = count($array); | |
$strlength = |
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 "even" class to every 2nd post/CBT | |
function aa_archive_post_class( $classes ) { | |
// Don't run on single posts or pages | |
if( is_singular() ) | |
return $classes; | |
global $wp_query; | |
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 ) |