Skip to content

Instantly share code, notes, and snippets.

<?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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.oldsite.com', 'http://www.newsite.com');
@billerickson
billerickson / functions.php
Created February 10, 2012 19:38 — forked from GaryJones/functions.php
Genesis Grid Loop - Parts 1-3
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
@billerickson
billerickson / functions.php
Created February 9, 2012 15:42 — forked from GaryJones/functions.php
Genesis Grid Loop - Parts 1-3
<?php
/**
* Possibly amend the loop.
* Specify the conditions under which the grid loop should be used
*
* @author Bill Erickson
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
*/
function child_maybe_do_grid_loop() {