Skip to content

Instantly share code, notes, and snippets.

@BrianBourn
Last active August 29, 2015 14:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianBourn/fdafe388e59c6f9470ba to your computer and use it in GitHub Desktop.
Save BrianBourn/fdafe388e59c6f9470ba to your computer and use it in GitHub Desktop.
Dealing with Genesis Simple Sidebars
<?php
//***Add Simple Sidebar Functionality To Author Archives**/
add_action( 'get_header', 'bourncreative_simplesidebars_check' );
function bourncreative_simplesidebars_check() {
if ( function_exists( 'ss_sidebars_init' ) && is_active_sidebar( 'caterina-rando-sidebar' ) ) {
remove_action( 'genesis_sidebar_alt', 'ss_do_sidebar_alt' ); // Unhook Genesis Simple Sidebars
add_action( 'genesis_sidebar_alt', 'bourncreative_author_sidebar_alt' ); // Add Back Custom Sidebar Created With Simple Sidebars
function bourncreative_author_sidebar_alt() {
dynamic_sidebar( 'caterina-rando-sidebar' );
}
}
}
<?php
remove_action( 'get_header', 'ss_sidebars_init' ); // Override Genesis Simple Sidebars
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
add_action( 'genesis_sidebar', 'jesse_sidebar_function' );
function jesse_sidebar_function() {
if ( is_active_sidebar( 'your-sidebar' ) ) {
dynamic_sidebar( 'your-sidebar' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment