Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created February 1, 2012 15:31
Show Gist options
  • Save billerickson/1717547 to your computer and use it in GitHub Desktop.
Save billerickson/1717547 to your computer and use it in GitHub Desktop.
<?php
add_action( 'genesis_after_header', 'be_change_sidebar_order' );
/**
* Swap Primary and Secondary Sidebars on Sidebar-Sidebar-Content
*
* @author Bill Erickson
* @link http://www.billerickson.net/switch-genesis-sidebars/
*/
function be_change_sidebar_order() {
$site_layout = genesis_site_layout();
if ( 'sidebar-sidebar-content' == $site_layout ) {
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
// Remove the Secondary Sidebar from the Secondary Sidebar area.
remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' );
// Place the Secondary Sidebar into the Primary Sidebar area.
add_action( 'genesis_sidebar', 'genesis_do_sidebar_alt' );
// Place the Primary Sidebar into the Secondary Sidebar area.
add_action( 'genesis_sidebar_alt', 'genesis_do_sidebar' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment