Skip to content

Instantly share code, notes, and snippets.

View anneallen's full-sized avatar

Anne Allen anneallen

View GitHub Profile
@anneallen
anneallen / gist:613d5a629eec7857f313
Created February 16, 2016 01:17
Add Open Graph Protocol tags to Genesis Child theme
//*Enqueue Font Awesome for icons
add_action( 'wp_enqueue_scripts', 'child_enqueue_scripts_styles' );
function child_enqueue_scripts_styles() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), CHILD_THEME_VERSION );
}
//*Add Open Graph Stuff
@anneallen
anneallen / Generic Placeholder Form
Created January 17, 2016 21:14
Generic Placeholder Form
<form action="#" method="post">
<input type="text" tabindex="500" value="NAME" onblur="if(this.value == '') { this.value='NAME'}" onfocus="if (this.value == 'NAME') {this.value=''}" name="name" id="input-name">
<input type="text" tabindex="501" value="EMAIL" onblur="if(this.value == '') { this.value='EMAIL'}" onfocus="if (this.value == 'EMAIL') {this.value=''}" name="email" id="input-name">
<input type="submit" tabindex="502" value="Subscribe" id="input-submit" name="submit">
</form>
@anneallen
anneallen / gist:260e1a7a58b0e3a4e1e0
Last active March 9, 2016 21:37
video splash for vimeo and youtube embeds
<div class="video-container">
<img src="...splash.jpg" alt="my splash" width="901" height="513" class="videosplash aligncenter size-full wp-image-1970" data-video="https://player.vimeo.com/video/xyz123?title=0&byline=0&portrait=0andamp;autoplay=1" />
</div>
<script type="text/javascript">
jQuery(function( $ ){
$('img').click(function(){
var video = '<iframe src="'+ $(this).attr('data-video') +'"></iframe>';
$(this).replaceWith(video);
@anneallen
anneallen / gist:4a3c90b48c0c40b39349
Created October 7, 2015 18:21
Add filter to Gravity forms to return to form top (not page top) when validation errors are present
//Gravity forms - keep form visible if validation problems
add_filter("gform_confirmation_anchor", create_function("","return true;"));
// hook into the init action and call create_boat_taxonomies when it fires
add_action( 'init', 'create_boat_taxonomies', 0 );
// create 2 taxonomies, Type, Manufacturer, for the post type "boat"
function create_boat_taxonomies() {
//*Type
$types = array(
// Pledge Items
@anneallen
anneallen / gist:4f5c38f9aef27d812af8
Created June 4, 2015 18:02
Rejig Genesis header for Center Logo and widget area left and right
//* Rejig the header
//*Create Header Left Widget Area
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'header-left',
'name' => __( 'Header - Left', 'agentpress' ),
'description' => __( 'This is the Left section of the header.', 'agentpress' ),
) );
@anneallen
anneallen / gist:4e9418d0b1a59459f3c0
Created April 21, 2015 17:44
Using Boostrap Toggle in WordPress Custom Post Archive
remove_action('genesis_loop','genesis_do_loop');
add_action('genesis_loop','child_shopping_loop');
add_action( 'wp_enqueue_scripts', 'bootstrap_enqueue_scripts' );
function child_shopping_loop() {
@anneallen
anneallen / gist:9fa29569fbccf4d43cea
Last active August 29, 2015 14:17
Apply complex sort order to genesis loop
function child_before_loopargs(){
global $wp_query;
$args = array(
'orderby' => array( 'meta_value_num' => 'DESC', 'title' => 'ASC' ),
'meta_key' => '_cmb2_b_year');
query_posts(array_merge( $wp_query->query,$args ));
}
@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
*/
@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: [