Skip to content

Instantly share code, notes, and snippets.

@cre8tivediva
Last active Aug 21, 2017
Embed
What would you like to do?
Add Disclaimer Above Blog Posts
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'affiliate-disclaimer',
'name' => __( 'Affiliate Disclaimer', 'themename' ),
'description' => __( 'This is the affiliate disclaimer widget area.', 'themename' ),
) );
//* Hook before header widget area above header
add_action( 'genesis_entry_header', 'before_content_affiliate_disclaimer', 15 );
function before_content_affiliate_disclaimer() {
if ( ! is_singular( 'post' ) ) {
return;
}
genesis_widget_area( 'affiliate-disclaimer', array(
'before' => '<div class="affiliate-disclaimer" class="widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
.affiliate-disclaimer {
background-color: #f9f9f9;
margin-bottom: 35px;
padding: 15px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment