Skip to content

Instantly share code, notes, and snippets.

@surefirewebserv
Last active August 29, 2015 14:19
Show Gist options
  • Save surefirewebserv/0b45eef5da52871c60df to your computer and use it in GitHub Desktop.
Save surefirewebserv/0b45eef5da52871c60df to your computer and use it in GitHub Desktop.
Widget Before and after.
<?php
// Don't inlude the PHP tag, just copy whats below.
//* Contact Widget
genesis_register_sidebar( array(
'id' => 'contact-widget',
'name' => __( 'Contact Widget', 'genesis' ),
'description' => __( 'Contains Contact Information under the Content Area' ),
) );
//* Events Widget
genesis_register_sidebar( array(
'id' => 'events-widget',
'name' => __( 'Events Widget for Home Page', 'genesis' ),
'description' => __( 'Contains Events Widget under the Content Area' ),
) );
add_action( 'genesis_after_entry', 'sfws_add_genesis_widget_area' );
function sfws_add_genesis_widget_area() {
if ( is_page('006') && is_active_sidebar('contact-widget') ) {
// echo "open some tag here" //If I wanted to open a div or anything else to wrap the two widgets, i would do it yhere
genesis_widget_area( 'contact-widget', array(
'before' => '<div class="contact-widget-wrapper one-half first">',
'after' => '</div>',
) );
genesis_widget_area( 'events-widget', array(
'before' => '<div class="events-widget-wrapper one-half">',
'after' => '</div>',//* Ends Home Widget Container
) );
// echo "close some tag here" //And here is where I would close those open tags if I added any.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment