Last active
September 30, 2015 01:17
-
-
Save GaryJones/1698319 to your computer and use it in GitHub Desktop.
Split Sidebar in Genesis - http://gamajo.com/split-sidebar-genesis
This file contains hidden or 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 | |
// 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 | |
} |
This file contains hidden or 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
.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