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' => 'custom-widget', | |
'name' => __( 'Custom Widget', 'wpsites' ), | |
'description' => __( 'Display Content Before Blog Page Loop', 'wpsites' ), | |
) ); | |
/** | |
* @author Brad Dalton - WP Sites | |
* @example http://wp.me/p1lTu0-9NG | |
*/ | |
add_action( 'genesis_before_content', 'wpsites_custom_widget', 5 ); | |
function wpsites_custom_widget() { | |
if ( is_page_template( 'page_blog.php' ) && is_active_sidebar( 'custom-widget' ) ) | |
genesis_widget_area( 'custom-widget', array( | |
'before' => '<aside class="custom-widget">', | |
'after' => '</aside>', | |
) ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updating to say I found a way to do this...