Skip to content

Instantly share code, notes, and snippets.

@nickcernis
Created November 26, 2014 19:03
Show Gist options
  • Save nickcernis/81b4dac8fcc59525a307 to your computer and use it in GitHub Desktop.
Save nickcernis/81b4dac8fcc59525a307 to your computer and use it in GitHub Desktop.
functions.php
add_action('genesis_after_header', 'wpsites_two_column_widgets');
/*** @author Brad Dalton* @example http://wpsites.net/* @copyright 2014 WP Sites */
function wpsites_two_column_widgets()
{
if (is_front_page() && is_active_sidebar('left-column') || is_active_sidebar('right-column')) {
echo '<div class="two-column-widgets">';
echo '<div class="wrap">';
genesis_widget_area('left-column',
array(
'before' => ' <div class="left-column widget-area">',
'after' => '</div>'
)
);
genesis_widget_area('right-column',
array(
'before' => '<div class="right-column widget-area">',
'after' => '</div>'
)
);
echo '</div>';
echo '</div>';
}
}
genesis_register_sidebar(
array(
'id' => 'left-column',
'name' => __('Left Column', 'wpsites'),
'description' => __('This is the left column widget for the slider.', 'wpsites'),
));
genesis_register_sidebar(
array(
'id' => 'right-column',
'name' => __('Right Column', 'wpsites'),
'description' => __('This is the right column widget for genesis enews widget.', 'wpsites'),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment