Skip to content

Instantly share code, notes, and snippets.

@ModernMuse
Created July 21, 2013 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ModernMuse/f4a3c3ac4d5494a85518 to your computer and use it in GitHub Desktop.
Save ModernMuse/f4a3c3ac4d5494a85518 to your computer and use it in GitHub Desktop.
Add custom widget for the about page below the Genesis header.
genesis_register_sidebar( array(
'id' => 'page-widget',
'name' => __( 'Page Widget', 'wpsitesdotnet' ),
'description' => __( 'About page widget.', 'wpsitesdotnet' )
) );
/**
* @author Brad Dalton - WP Sites
* @example http://wp.me/p1lTu0-9Jr
*/
add_action( 'genesis_after_header', 'wpsites_page_widget', 5 );
function wpsites_page_widget() {
if ( is_page('about-me') && is_active_sidebar( 'page-widget' ) ) {
echo '<div class="widget">';
dynamic_sidebar( 'page-widget' );
echo '</div><!-- end .page-widget -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment