Skip to content

Instantly share code, notes, and snippets.

View anneallen's full-sized avatar

Anne Allen anneallen

View GitHub Profile
/**
*This creates a box for optin, with separate text and form
*/
/** Register Opt in Widget **/
function lob_signup_box_load_widgets() {
register_widget( 'lob_signup_box_Widget' );
}
add_action( 'widgets_init', 'lob_signup_box_load_widgets' );
//Clicky Boxes
/**
*This creates a widget area for text, and the whole box is clickable
*
*/
/** Register Widget **/
function lob_boxes_load_widgets() {
register_widget( 'Lob_Boxes_Widget' );
@anneallen
anneallen / gist:10340261
Last active August 29, 2015 13:58
Remove Genesis Post meta and Post info for all but standard posts
//Remove post-info and post meta for all but post
remove_action('genesis_entry_header', 'genesis_post_info',12);
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
add_action('genesis_entry_header', 'child_post_info',12);
function child_post_info(){
if (is_singular( 'post' ))
genesis_post_info();
}
// ADDING CUSTOM POST TYPE - business card
add_action('init', 'all_custom_post_types');
function all_custom_post_types() {
$types = array(
// Pledge Items
array('the_type' => 'bcard',
'single' => 'Business Card',
@anneallen
anneallen / gist:9605275
Created March 17, 2014 18:25
Social share buttons for genesis
add_action( 'genesis_entry_content', 'child_share_buttons',6);
function child_share_buttons (){
$return_string .='<ul class="share_buttons">';
$return_string .= '<li>
<a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a> </li>
<li class="fb">
<div class="fb-share-button" data-href="http://developers.facebook.com/docs/plugins/" data-type="button"></div>
</li>
@anneallen
anneallen / gist:7420354
Created November 11, 2013 21:08
Add Placeholder text to wordpress login forms
// JavaScript Document
jQuery(function ($) {
/* You can safely use $ in this code block to reference jQuery */
$(document).ready(function(){
$('form').find('input[name="log"]').each(function(ev)
{
if(!$(this).val()) {
@anneallen
anneallen / gist:7341433
Created November 6, 2013 18:23
Add ie selector to html tag
function eva_IE_doctype() {
?>
<!DOCTYPE html>
<!--[if IEMobile 7 ]> <html dir="ltr" lang="en-US"class="no-js iem7"> <![endif]-->
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie6 oldie"> <![endif]-->
<!--[if IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie7 oldie"> <![endif]-->
<!--[if IE 8 ]> <html dir="ltr" lang="en-US" class="no-js ie8 oldie"> <![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html <?php language_attributes( 'html' ); ?>><!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
@anneallen
anneallen / Modernizer
Last active December 27, 2015 14:29
Add Modernizer to html class
//Add Modernizer
function eva_modernizer_doctype() {
?>
<!DOCTYPE html>
<html class="no-js" <?php language_attributes( 'html' ); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php
}
@anneallen
anneallen / gist:6966997
Created October 13, 2013 20:20
Allow line breaks and spans in widget title
/**Allow line breaks and spans in widget title*/
add_filter('widget_title','my_widget_title',10,3);
function my_widget_title($title)
{
$title = str_replace("[br]", "<br/>", $title);
$title = str_replace("[sp]", "<span>", $title);
$title = str_replace("[/sp]", "</span>", $title);
return $title;
}
@anneallen
anneallen / gist:6856834
Created October 6, 2013 17:35
Mobile redirect - just discovered it as a built in Wordpress function
if ( wp_is_mobile() ) {
wp_redirect( 'http://example.com/m/' );
exit;
}