Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Last active September 30, 2015 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save GaryJones/1698319 to your computer and use it in GitHub Desktop.
Save GaryJones/1698319 to your computer and use it in GitHub Desktop.
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