-
-
Save jamiemitchell/98c06014c318960b7326b640328a3f09 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Register Archive Sidebar | |
* | |
*/ | |
function be_register_archive_sidebar() { | |
genesis_register_sidebar( array( 'name' => 'Archive Sidebar', 'id' => 'archive-sidebar' ) ); | |
} | |
add_action( 'genesis_setup', 'be_register_archive_sidebar', 20 ); | |
/** | |
* Display Archive Sidebar | |
* | |
*/ | |
function be_archive_sidebar() { | |
// Only adjust on archives | |
if( ! ( is_archive() || is_404() ) ) | |
return; | |
// Remove Genesis Sidebar | |
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); | |
// Remove Genesis Simple Sidebars sidebar | |
if( function_exists( 'ss_do_sidebar' ) ) | |
remove_action( 'genesis_sidebar', 'ss_do_sidebar' ); | |
// Add my sidebar | |
dynamic_sidebar( 'archive-sidebar' ); | |
} | |
add_action( 'genesis_sidebar', 'be_archive_sidebar', 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment