Last active
December 16, 2015 11:38
-
-
Save braddalton/5428265 to your computer and use it in GitHub Desktop.
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
/** 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