Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Created October 1, 2012 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save GaryJones/3811839 to your computer and use it in GitHub Desktop.
Save GaryJones/3811839 to your computer and use it in GitHub Desktop.
<?php
add_action( 'genesis_after_sidebar_widget_area', 'child_split_sidebars' );
/**
* In the primary sidebar, after the original widget area, split into two
* widget areas, before continuing with a full-sidebar-width widget area.
*
* @since 1.0.0
*
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-split-sidebars/#comment-7098
*/
function child_split_sidebars() {
?>
<div class="sidebar-middle">
<div class="sidebar-middle-left">
<?php dynamic_sidebar( 'sidebar-middle-left' ); ?>
</div><!-- end .sidebar-middle-left -->
<div class="sidebar-middle-right">
<?php dynamic_sidebar( 'sidebar-middle-right' ); ?>
</div><!-- end .sidebar-middle-right -->
</div><!-- end .sidebar-middle -->
<div class="sidebar-bottom">
<?php dynamic_sidebar( 'sidebar-bottom' ); ?>
</div><!-- end .sidebar-bottom -->
<?php
}
// Register the sidebars with WordPress
genesis_register_sidebar(
array(
'id' => 'sidebar-middle-left',
'name' => __( 'Sidebar Middle Left', 'theme-text-domain' ),
'description' => __( 'This shows up on the left side of the split sidebars.', 'theme-text-domain' ),
)
);
genesis_register_sidebar(
array(
'id' => 'sidebar-middle-right',
'name' => __( 'Sidebar Middle Right', 'theme-text-domain' ),
'description' => __( 'This shows up on the right side of the split sidebars.', 'theme-text-domain' ),
)
);
genesis_register_sidebar(
array(
'id' => 'sidebar-bottom',
'name' => __( 'Sidebar Bottom', 'theme-text-domain' ),
'description' => __( 'This shows up underneath the split sidebars.', 'theme-text-domain' ),
)
);
.sidebar-middle-left,
.sidebar-middle-right {
display: inline;
float: left;
width: 212px;
}
.sidebar-middle-right {
float: right;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment