Created
February 23, 2015 15:52
-
-
Save billerickson/c15e995540450a9abf92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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