Skip to content

Instantly share code, notes, and snippets.

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 braddalton/5889169 to your computer and use it in GitHub Desktop.
Save braddalton/5889169 to your computer and use it in GitHub Desktop.
genesis_register_sidebar( array(
'id' => 'custom-widget',
'name' => __( 'Custom Widget', 'wpsites' ),
'description' => __( 'Adds Custom Widget For Content Columns or Anything Else', 'wpsites' ),
) );
/**
* @author Brad Dalton - WP Sites
* @example http://wp.me/p1lTu0-9NG
*/
add_action( 'genesis_after_content_sidebar_wrap', 'wpsites_custom_widget', 5 );
function wpsites_custom_widget() {
if ( is_single() && is_active_sidebar( 'custom-widget' ) ) {
echo '<div class="custom-widget">';
dynamic_sidebar( 'custom-widget' );
echo '</div><!-- end .custom-widget -->';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment