Created
February 1, 2012 15:31
-
-
Save billerickson/1717547 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 | |
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