Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Split Sidebar in Genesis - http://gamajo.com/split-sidebar-genesis
<?php
// Don't include the <?php above
add_action( 'after_setup_theme', 'prefix_register_split_sidebars', 5 );
/**
* Register the two widget areas that make up our visually separated sidebar.
*
* @author Gary Jones
* @link http://gamajo.com/split-sidebar-genesis
*/
function prefix_register_split_sidebars() {
genesis_register_sidebar(
array(
'id' => 'prefix-split-sidebar-left',
'name' => __( 'Primary Sidebar Bottom Left', 'textdomain' ),
'description' => __( 'This shows up underneath the primary sidebar.', 'textdomain' ),
)
);
genesis_register_sidebar(
array(
'id' => 'prefix-split-sidebar-right',
'name' => __( 'Primary Sidebar Bottom Right', 'textdomain' ),
'description' => __( 'This shows up underneath the primary sidebar.', 'textdomain' ),
)
);
}
add_action( 'genesis_after_sidebar_widget_area', 'prefix_display_split_sidebars' );
/**
* Add two sidebars underneath the primary sidebar.
*
* @since 1.0.0
*
* @author Gary Jones
* @link http://gamajo.com/split-sidebar-genesis
*/
function prefix_display_split_sidebars() {
?>
<div class="split-sidebars">
<?php
genesis_widget_area( 'prefix-split-sidebar-left' );
genesis_widget_area( 'prefix-split-sidebar-right' );
?>
</div>
<?php
}
.split-sidebars > .widget-area {
float: left;
width: 50%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment