Skip to content

Instantly share code, notes, and snippets.

@stephtreasure
Created February 20, 2015 21:34
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 stephtreasure/02ab5f7f286586603bc6 to your computer and use it in GitHub Desktop.
Save stephtreasure/02ab5f7f286586603bc6 to your computer and use it in GitHub Desktop.
<?php
// Start the engine
require_once( get_template_directory() . '/lib/init.php' );
// Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
// Add Viewport meta tag for mobile browsers
add_action( 'genesis_meta', 'sample_viewport_meta_tag' );
function sample_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}
// Add support for custom background
add_theme_support( 'custom-background' );
// Add support for custom header
add_theme_support( 'genesis-custom-header', array(
'width' => 1152,
'height' => 120
) );
// Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );
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