Last active
August 29, 2015 14:09
-
-
Save j-mccarthy/cf8e28587a5e19dbcd47 to your computer and use it in GitHub Desktop.
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 // <- Remove <?php if your using this snippet | |
// Hook in just before the main content-sidebar-wrap | |
add_action( 'genesis_before_content_sidebar_wrap', 'custom_layout_sidebar' ); | |
function custom_layout_sidebar() { | |
$layout = genesis_site_layout(); | |
// check to see if the custom layout exists | |
if( 'layout-name' == $layout ) { | |
echo '<div id="custom-sidebar">'; | |
// Open genesis structural wrap | |
// Registered your wrap with add_theme_support( 'genesis-structural-wraps', array(, 'custom-sidebar' ) ); in functions.php | |
genesis_structural_wrap( 'custom-sidebar' ); | |
// Add our sidebar | |
dynamic_sidebar( 'custom-sidebar' ); | |
// Close the structural wrap | |
genesis_structural_wrap( 'custom-sidebar', 'close' ); | |
echo '</div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment