Created
February 23, 2018 19:24
-
-
Save anwerashif/507c6d74f2d0dc988879a0fe8655b649 to your computer and use it in GitHub Desktop.
Register a Widget Area and Display After Content-Sidebar
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
<?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