Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Template Name: Residential Portfolio
*
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_press_loop' ); // Add custom loop
function custom_do_press_loop() {
add_action( 'pre_get_posts', 'test_per_dic' );
/**
* Exclude Category from Blog
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
function test_per_dic( $query ) {
<?php
/**
* Metaboxes
*
* This file registers any custom metaboxes
*
* @package Core_Functionality
* @since 1.0.0
* @link https://github.com/billerickson/Core-Functionality
* @author Bill Erickson <bill@billerickson.net>
<?php
/** Add Project Information After Content */
add_action ( 'genesis_sidebar', 'mmi_sing_project_side' );
function mmi_sing_project_side() {
echo '<div class="mmi-sidebar">';
echo '<section class="widget">';
echo '<h4 class="widgettitle">Participate In This Project</h4>';
$participants = get_post_meta(get_the_ID(), 'participants_needed', false);
@billerickson
billerickson / functions.php
Last active December 17, 2015 18:59 — forked from jamiemitchell/taxonomy-product_category.php
Use the main loop, not a custom loop. Customize the loop parameters using 'pre_get_posts' in functions.php.
<?php
/**
* Customize Product Category Query
* @link http://www.billerickson.net/customize-the-wordpress-query/
*/
function be_product_category_query( $query ) {
if( $query->is_main_query() && !is_admin() && $query->is_tax( 'product-category' ) ) {
$query->set( 'orderby', 'title' );
<?php
add_action( 'genesis_before_loop', 'child_maybe_do_grid_loop' );
function child_maybe_do_grid_loop() {
// Amend this conditional to pick where this grid looping occurs
if ( is_page('2') ) {
remove_action('genesis_before_post_content', 'genesis_post_info');
@billerickson
billerickson / gist:3714550
Created September 13, 2012 14:09 — forked from anonymous/gist:3712088
Sample Child Theme with Post Format
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );
/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Sample Child Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/genesis' );
/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'add_viewport_meta_tag' );
@billerickson
billerickson / custom_grid_loop_content.php
Created October 9, 2012 23:25
Customizing Grid Loop Content
/** Customize Blog Post Content */
function atb_test( $content ) {
global $post;
if( ! ( in_array( 'feature', get_post_class() ) || in_array( 'one-third', get_post_class() ) )
return $content;
// First Page Classes
if( ! $wp_query->query_vars['paged'] ) {
// Features
<?php
/**
Template Name: Author Page
*/
get_header(); ?>
<div id="container">
<div id="content" class="page">
@billerickson
billerickson / template-books.php
Created March 22, 2012 13:17
Books Page Template
<?php
/*
Template Name: Books LATEST
*/
/**
* Modify Post Navigation
* @since 1.0.0
*
*