Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created February 23, 2015 15:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/c15e995540450a9abf92 to your computer and use it in GitHub Desktop.
Save billerickson/c15e995540450a9abf92 to your computer and use it in GitHub Desktop.
<?php // don't include this line
/**
* Register the homepage sidebar
*
*/
function be_register_home_sidebar() {
genesis_register_widget_area( array( 'id' => 'home-sidebar', 'name' => 'Home Sidebar' ) );
}
add_action( 'genesis_setup', 'be_register_home_sidebar', 15 );
/**
* Display homepage sidebar
*
*/
function be_display_home_sidebar() {
if( ! is_front_page() ) // change this to is_home() if you're using a blog homepage
return;
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
if( function_exists( 'ss_do_sidebar' ) )
remove_action( 'genesis_sidebar', 'ss_do_sidebar' );
dynamic_sidebar( 'home-sidebar' );
}
add_action( 'genesis_sidebar', 'be_display_home_sidebar', 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment