Skip to content

Instantly share code, notes, and snippets.

Bill Erickson billerickson

Block or report user

Report or block billerickson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View functions.php
/**
* Customize Blog Query
*
*/
function be_blog_query( $query ) {
if( $query->is_main_query() && !is_admin() && $query->is_home() ) {
$query->set( 'cat', 5 );
}
}
View gist:9259878
function ja_force_layout( $layout ) {
if ( is_home() || is_archive() || is_singular( 'post' ) ) {
$layout = 'full-width-content';
}
}
add_action( 'genesis_pre_get_option_site_layout', 'ja_force_layout' );
View gist:9253556
**
* Customize Blog Query
*
*/
function be_blog_query( $query ) {
if( $query->is_main_query() && !is_admin() && $query->is_home() ) {
$query->set( 'category_name', array( 'cat-1', 'cat-2', 'cat-3' ) );
}
}
add_action( 'pre_get_posts', 'be_blog_query' );
View gist:9257683
$display = is_home() || is_archive() || is_single();
if( ! apply_filters( 'ja_blog_sidebar_display', $display ) )
return;
View archive-films.php
<?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>';
View functions.php
<?php
/**
* Blog Sidebar
*
*/
function be_blog_sidebar() {
if( is_home() || is_archive() || is_singular( 'post' ) ) {
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
if( function_exists( 'ss_do_sidebar' ) )
View functions.php
<?php
/**
* ACF Table Shortcode
*
*/
function be_acf_table_shortcode( $value, $post_id, $field ) {
if( 'shortcode' !== $field['_name'] )
return $value;
View functions.php
<?php
/**
* Global enqueues
*
* @since 1.0.0
* @global array $wp_styles
*/
function ea_global_enqueues() {
wp_enqueue_style( 'genericons', get_stylesheet_directory_uri() . '/css/genericons.css' );
View functions.php
<?php
/**
* Add Site Name as Body Class
*
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-class-body-tag/
*
* @param array $classes
* @return array
View functions.php
<?php
/**
* Portfolio Template for Taxonomies
*
*/
function be_portfolio_template( $template ) {
if( is_tax( array( 'portfolio_category', 'portfolio_tag' ) ) )
$template = get_query_template( 'archive-portfolio' );
You can’t perform that action at this time.