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/5428265 to your computer and use it in GitHub Desktop.
Save braddalton/5428265 to your computer and use it in GitHub Desktop.
/** Register before loop widget area **/
genesis_register_sidebar( array(
'id' => 'before-loop',
'name' => __( 'Before Loop Widget', 'child' ),
'description' => __( 'This is the Before Loop widget area which outputs on your blog page.', 'child' ),
) );
/**
* @author Brad Dalton
* @link http://wpsites.net/
*/
/** Hook in Before Loop Widget */
add_action( 'genesis_before_loop', 'wpsites_before_loop_widget', 5 );
function wpsites_before_loop_widget() {
if ( is_page('blog') && is_active_sidebar( 'before-loop' ) ) {
echo '<div class="before-loop>';
dynamic_sidebar( 'before-loop' );
echo '</div><!-- end .before-loop -->';
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment