Skip to content

Instantly share code, notes, and snippets.

/**
* Customize Blog Query
*
*/
function be_blog_query( $query ) {
if( $query->is_main_query() && !is_admin() && $query->is_home() ) {
$query->set( 'cat', 5 );
}
}
<?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>';
**
* 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' );
<?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' ) )
$display = is_home() || is_archive() || is_single();
if( ! apply_filters( 'ja_blog_sidebar_display', $display ) )
return;
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' );
<?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' );
<?php
/**
* ACF Table Shortcode
*
*/
function be_acf_table_shortcode( $value, $post_id, $field ) {
if( 'shortcode' !== $field['_name'] )
return $value;
<?php
/**
* Add Site Name as Body Class
*
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-class-body-tag/
*
* @param array $classes
* @return array
<?php
// add_image_size( size_name, width, height, crop (true/false) );
add_image_size( 'be_portfolio', 400, 200, true );