Last active
December 20, 2015 01:29
-
-
Save braddalton/6049246 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
genesis_register_sidebar( array( | |
'id' => 'page-widget', | |
'name' => __( 'Page Widget', 'wpsitesdotnet' ), | |
'description' => __( 'Contact page widget.', 'wpsitesdotnet' ) | |
) ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wp.me/p1lTu0-9Jr | |
*/ | |
add_action( 'genesis_before_content_sidebar_wrap', 'wpsites_page_widget', 5 ); | |
function wpsites_page_widget() { | |
if ( is_page('about-page') && 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