Skip to content

Instantly share code, notes, and snippets.

<?php
//* Add sorting buttons
add_action('genesis_before_loop', 'ac_sort_buttons');
function ac_sort_buttons() {
echo '<p>';
echo 'Sort:';
echo '<a href="?sort=oldest">Oldest</a>';
echo '<a href="?sort=alpha">Alphabetical</a>';
@billerickson
billerickson / 0_reuse_code.js
Created June 4, 2014 13:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@billerickson
billerickson / genesis-layout-extras.php
Created November 9, 2011 20:01 — forked from deckerweb/genesis-layout-extras.php
Genesis Layout Extras Plugin 1.3-alpha -- For Genesis 1.8 and new Admin Classes
<?php
/**
* Main plugin file. This plugin for Genesis Theme Framework allows modifying of default layouts for
* homepage, singular, archive, attachment, search, 404 and even bbPress 2.x pages via Genesis theme settings.
*
* @package GenesisLayoutExtras
* @author David Decker
* @origin Based on the work of @WPChildThemes for original plugin called "Genesis Layout Manager" (C) 2010
*
* Plugin Name: Genesis Layout Extras
@billerickson
billerickson / sidebar.php
Created December 20, 2011 22:40 — forked from smeyer/sidebar.php
Sidebar file for Chameleon
<div id="sidebar">
<?php do_action( 'be_sidebar' ); ?>
</div> <!-- end #sidebar -->
@billerickson
billerickson / classroomstyle
Created January 1, 2012 14:16 — forked from jbreitenbucher/classroomstyle
Code to return data from multicheck taxonomy field
$styles = maybe_unserialize( get_post_meta($post->ID, 'it_classroom_style_taxonomy',true) );
echo $styles[0];
$style = get_term_by( 'id', $styles[0], 'style' );//get_term($styles[0], 'style');
print_r($style);
echo $style->name;
@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() {
@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 / widget nav.php
Created February 11, 2012 01:13 — forked from chadmohr/widget nav
Genesis widget area next to nav
<?php
add_filter( 'genesis_nav_items', 'sws_social_icons', 10, 2 );
add_filter( 'wp_nav_menu_items', 'sws_social_icons', 10, 2 );
function sws_social_icons($menu, $args) {
$args = (array)$args;
if ( 'primary' !== $args['theme_location'] )
return $menu;
ob_start();
@billerickson
billerickson / taxonomy-type.php
Created February 28, 2012 02:41 — forked from lorinrivers/taxonomy-type.php
taxonomy type
<?php
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'do_film_loop');
function do_film_loop(){
$video_file_args = array(
'post_type' => 'film',
'order_by' => 'title',
'order' => 'ASC',
@billerickson
billerickson / functions.php
Created March 22, 2012 00:00 — forked from graphicagenda/gist:2154264
Genesis Custom Body Class
<?php
add_filter( 'body_class', 'gk_add_body_class' );
function gk_add_body_class( $classes ) {
$classes[] = 'custom-class';
if ( !empty( $_GET['bg'] ) )
$classes[] = 'bg' . esc_attr( $_GET['bg'] );
return $classes;
}