Created
November 19, 2014 10:27
-
-
Save j-mccarthy/db954dfa90d5e883f875 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 | |
/** | |
* CENTER CONTENT / BOTTOM SIDEBAR | |
*/ | |
// Register New Layout | |
function jm_center_post_layout() { | |
genesis_register_layout( 'center-bottom', array( | |
'label' => __('Center/Bottom', 'genesis'), | |
'img' => get_bloginfo('stylesheet_directory') . '/images/cbss.gif' | |
) ); | |
} | |
add_action( 'init', 'jm_center_post_layout' ); | |
// New layout Logic | |
function jm_center_post_layout_logic() { | |
$site_layout = genesis_site_layout(); | |
if ( $site_layout == 'center-bottom' ) { | |
// Remove default genesis sidebars | |
remove_action( 'genesis_after_content', 'genesis_get_sidebar' ); | |
remove_action( 'genesis_after_content_sidebar_wrap', 'genesis_get_sidebar_alt'); | |
// Add layout specific sidebars | |
add_action( 'genesis_after_content_sidebar_wrap', 'jm_do_sidebar_bottom' ); | |
} | |
} | |
add_action('genesis_before', 'jm_center_post_layout_logic'); | |
// Register sidebar | |
genesis_register_sidebar(array( | |
'name'=>'SidebarBottom', | |
'id' => 'sidebar-bottom', | |
'description' => 'Below content just above the footer' | |
)); | |
// Our sidebar | |
function jm_do_sidebar_bottom() { | |
echo '<div class="bottom-sidebar">'; | |
genesis_structural_wrap( 'sidebar-bottom' ); | |
dynamic_sidebar( 'sidebar-bottom' ); | |
genesis_structural_wrap( 'sidebar-bottom', 'close' ); | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment