Sidebarwide_sidebar _content

This is a great snippet from Christopher at Genesis Tutorials.

This snippet is for Sidebar Sidebar Content Layout and will swap places of the wide and narrow sidebars.

add_action( 'genesis_before', 'gt_switch_sidebars' );
function gt_switch_sidebars() {
    $site_layout = genesis_site_layout();
    if ( $site_layout == 'sidebar-sidebar-content' ) {
        remove_action( 'genesis_after_content', 'genesis_get_sidebar' );
        remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt');
        add_action( 'genesis_after_content', 'genesis_get_sidebar_alt' );
        add_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar');
   }
}

You may need to modify your child theme’s style.css in order to fit the swapped sidebars. For the default example child theme find #content-sidebar-wrap and change the width to 640px.

With a big change like this to the layout I would suggest registering a new layout to use for this code. Simply Register a new layout with:

genesis_register_layout( 'sidebarwide-sidebar-content', array(
    'label' => 'Wide Sidebar/Sidebar/Content',
    'img' => CHILD_URL . '/images/wssc.gif',
) );

With the new registered layout use sidebarwide-sidebar-content in place of sidebar-sidebar-content in the switch function.

Use the image to the left to just give it that extra touch!
( place the image in your child theme’s images folder ).

About Greg Wallace

My name is Greg Wallace. I am a WordPress website developer and designer specializing in the Genesis Framework by StudioPress.

Speak Your Mind

*