Skip to content

Instantly share code, notes, and snippets.

@bradpotter
Last active August 29, 2015 14:21
Show Gist options
  • Save bradpotter/67898bf840618660c5e6 to your computer and use it in GitHub Desktop.
Save bradpotter/67898bf840618660c5e6 to your computer and use it in GitHub Desktop.
Page template to use with auto sidebar registration
<?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