Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created July 24, 2014 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/535f042d569c2683f6cc to your computer and use it in GitHub Desktop.
Save billerickson/535f042d569c2683f6cc to your computer and use it in GitHub Desktop.
<?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