Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Created January 4, 2016 00:32
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 jamiemitchell/915b3e62363b23008721 to your computer and use it in GitHub Desktop.
Save jamiemitchell/915b3e62363b23008721 to your computer and use it in GitHub Desktop.
Enterprise Pro front page with blog posts, home bottom widget below posts.
<?php
/**
* This file adds the Home Page to the Enterprise Pro Theme.
*
* @author StudioPress
* @package Enterprise Pro
* @subpackage Customizations
*/
add_action( 'genesis_meta', 'enterprise_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function enterprise_home_genesis_meta() {
if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-bottom' ) ) {
//* Add enterprise-pro-home body class
add_filter( 'body_class', 'enterprise_body_class' );
//* Add home top widgets
add_action( 'genesis_before_content_sidebar_wrap', 'enterprise_home_top_widgets', 1 );
//* Add home bottom widgets
add_action( 'genesis_after_content_sidebar_wrap', 'enterprise_home_bottom_widgets', 2 );
}
}
function enterprise_body_class( $classes ) {
$classes[] = 'enterprise-pro-home';
return $classes;
}
function enterprise_home_top_widgets() {
genesis_widget_area( 'home-top', array(
'before' => '<div class="home-top widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
function enterprise_home_bottom_widgets() {
genesis_widget_area( 'home-bottom', array(
'before' => '<div class="home-bottom widget-area">',
'after' => '</div>',
) );
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment