Last active
August 29, 2015 14:21
-
-
Save bradpotter/67898bf840618660c5e6 to your computer and use it in GitHub Desktop.
Page template to use with auto sidebar registration
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 | |
/** | |
* This file adds the Custom Widget Page Template to ThemeCore. | |
* | |
* @author Brad Potter | |
* @package ThemeCore | |
* @subpackage Customizations | |
*/ | |
/* | |
Template Name: Widget Page Template One | |
*/ | |
//* Hooks sidebar to page content | |
add_action( 'genesis_entry_content', 'gpb_page_sidebar' ); | |
function gpb_display_sidebar() { | |
$id = 'gpb-' . get_the_ID() . '-sidebar'; | |
if ( is_active_sidebar( $id ) ) { | |
dynamic_sidebar( $id ); | |
} | |
} | |
//* Run the Genesis loop | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment