Skip to content

Instantly share code, notes, and snippets.

@anwerashif
Created February 23, 2018 19:24
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 anwerashif/507c6d74f2d0dc988879a0fe8655b649 to your computer and use it in GitHub Desktop.
Save anwerashif/507c6d74f2d0dc988879a0fe8655b649 to your computer and use it in GitHub Desktop.
Register a Widget Area and Display After Content-Sidebar
<?php
// Do NOT the PHP opening tag
// Custom widget area for contact form
genesis_register_sidebar( array(
'id' => 'contact-before-footer',
'name' => __( 'Contact Before Footer', 'rainastudio' ),
'description' => __( 'Entry Contact Before Footer Content Widget', 'rainastudio' ),
));
// Display Contact Before Footer
function footer_contact_content() {
// Check widget activation
if ( is_active_sidebar( 'contact-before-footer' ) ) {
// Display the widget
genesis_widget_area( 'contact-before-footer', array (
'before' => '<div id="contact" class="contact-before-footer content-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
}
add_action( 'genesis_after_content_sidebar_wrap', 'footer_contact_content' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment