Skip to content

Instantly share code, notes, and snippets.

// Smooth scrolling anchor links
function ea_scroll( hash ) {
var target = $( hash );
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
var top_offset = 0;
if ( $('.site-header').css('position') == 'fixed' ) {
top_offset = $('.site-header').height();
}
if( $('body').hasClass('admin-bar') ) {
@billerickson
billerickson / functions.php
Created March 22, 2012 22:07
Customize Author Box
<?php
add_filter( 'genesis_author_box', 'be_author_box', 10, 6 );
/**
* Customize Author Box
* @author Bill Erickson
* @link http://www.billerickson.net/code/customize-author-box
*
* @param string $output
* @param string $context
@billerickson
billerickson / gist:1670316
Created January 24, 2012 14:04
Customize Roles & Capabilities
<?php
/**
* Customize Roles & Capabilities
*
* @package Dachis
* @subpackage Core Functionality
* @version 1.0
* @author Bill Erickson <bill@billerickson.net>
* @copyright Copyright (c) 2011, Bill Erickson
<?php
/**
* Register Archive Sidebar
*
*/
function be_register_archive_sidebar() {
genesis_register_sidebar( array( 'name' => 'Archive Sidebar', 'id' => 'archive-sidebar' ) );
}
add_action( 'genesis_setup', 'be_register_archive_sidebar', 20 );
<?php
/**
* Set Up Child Theme
*
*/
function child_theme_setup() {
// Set up Blog Sidebar
genesis_register_sidebar( array( 'name' => 'Blog Sidebar', 'id' => 'blog-sidebar' ) );
<?php
/*
* Resize images dynamically using wp built in functions
* @author Victor Teixeira
* @link http://core.trac.wordpress.org/ticket/15311
*
* php 5.2+
*
* Exemple use:
@billerickson
billerickson / gist:1398077
Created November 27, 2011 20:14
Multilinqual - Add Photographer Name and URL fields to media uploader
<?php
/**
* Add Photographer Name and URL fields to media uploader
*
* @param $form_fields array, fields to include in attachment form
* @param $post object, attachment record in database
* @return $form_fields, modified form fields
*/
<?php
/**
* Don't Update Plugin
*
* This prevents you being prompted to update if there's a public plugin
* with the same name.
*
* @since 1.0.0
* @author Mark Jaquith
<?php
/**
* General
*
* This file contains any general functions
*
* @package Core_Functionality
* @since 1.0.0
* @link https://github.com/billerickson/Core-Functionality
* @author Bill Erickson <bill@billerickson.net>
@billerickson
billerickson / gist:1888923
Created February 23, 2012 01:07
Popular Posts Widget
<?php
/**
* Popular Posts Widget
*
* Displays posts in last X days, sorted by most comments (proxy for popularity)
*
* @package Core Functionality
* @author Bill Erickson <bill@billerickson.net>
* @copyright Copyright (c) 2011, Bill Erickson
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License