Skip to content

Instantly share code, notes, and snippets.

View anneallen's full-sized avatar

Anne Allen anneallen

View GitHub Profile
@anneallen
anneallen / gist:ddd383b1bba13d0348af
Created May 13, 2014 21:16
Google maps API v3 Directions using data from cmb_field_map_master
//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' ));
@anneallen
anneallen / gist:dd47356e78ffadfbc785
Last active September 11, 2015 01:26
Replace Genesis Page tite with Fancy wordy title
//* 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(
@anneallen
anneallen / jquery-width-height
Created June 11, 2014 19:04
Jquery for screen width and height
jQuery(function ($) {
$(document).ready(function(e) {
showViewportSize();
});
$(window).resize(function(e) {
var windowsize = $(window).height();
$(".home-bottom").toggleClass("tiny",(windowsize < 780));
@anneallen
anneallen / jquery Bumper
Created June 11, 2014 19:05
Jquery bumper snippet
//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 */
});
@anneallen
anneallen / titletag_amend
Created June 18, 2014 18:42
Remove Yoast Wordpress SEO Title tag filter (genesis framework)
//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' ) : '–';
@anneallen
anneallen / gist:d2a831f07b7ba98bd211
Created December 5, 2014 06:15
Tiger Stripe to WP_query
$recent = new WP_Query(array(
'post_type'=> array( 'testimonial'),
'orderby' => 'date',
'order'=> 'DESC',
'posts_per_page'=> -1,
'homeselect'=>$taxon
));
@anneallen
anneallen / gist:a9672ad86f7984c5549c
Created December 15, 2014 19:16
Fix Lightbox showing behind Youtube iframe
//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>
@anneallen
anneallen / Rotate Videos
Created January 2, 2015 19:05
Rotate Video 90 degrees using Handbrake
//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
@anneallen
anneallen / gist:d1b6767cf8876644ba29
Created January 25, 2015 05:15
Simple Script for Google Map
<script type="text/javascript" >
jQuery(function( $ ){
function initialize() {
var myLatlng = new google.maps.LatLng(10.354859, -85.853784);
var stylez = [
{
featureType: "all",
elementType: "all",
stylers: [
@anneallen
anneallen / gist:999b386d2fb89b51fd62
Last active August 29, 2015 14:15
Add user level for editing custom post only Wordpress
<?php
/**
* Plugin Name: Sermon User
* Description: Adds a user level with access only to Sermons via wp admin
* Version: 0.1.0
* Author: Anne Allen
* Author URI: http://nustart.solutions/
* License: GPL2
*/