Created
October 1, 2012 13:35
-
-
Save GaryJones/3811839 to your computer and use it in GitHub Desktop.
Split sidebars solution for http://code.garyjones.co.uk/genesis-split-sidebars/#comment-7098
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_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' ), | |
) | |
); |
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
.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