Community Forums › Forums › Archived Forums › Design Tips and Tricks › Enterprise Pro Home Top
Tagged: Enterprise Pro
- This topic has 5 replies, 4 voices, and was last updated 10 years, 3 months ago by Kent.
-
AuthorPosts
-
March 4, 2014 at 10:03 pm #93466derekwbergMember
I would love to put 2 widgets side by side (2 column) in the top home section of enterprise pro. I want an image on the left and a leadbox code (code from leadpages.net) in a text widget on the right. As of now I can get them to show up on top of each other but would love them to be side by side whole maintaining the responsiveness.
Derek
http://www.clarendonhillsmusicacademy.com/March 6, 2014 at 4:51 am #93639Pixel FrauMemberYou could add a Genesis column class to each widget. The code for the widgets in your front-page.php file might look something like this.
function enterprise_home_top_widgets() { genesis_widget_area( 'home-top-left', array( 'before' => '<div class="home-top-left widget-area one-half first"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-top-right', array( 'before' => '<div class="home-top-right widget-area one-half"><div class="wrap">', 'after' => '</div></div>', ) ); }
March 11, 2014 at 9:07 am #94283derekwbergMemberFor some reason when I do that the home top disappears completely
Here is all of the code for front page
<?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' ) ) {
//* Force full-width-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );//* Add enterprise-pro-home body class
add_filter( 'body_class', 'enterprise_body_class' );//* Remove the default Genesis loop
remove_action( 'genesis_loop', 'genesis_do_loop' );//* Add home top widgets
add_action( 'genesis_after_header', 'enterprise_home_top_widgets' );//* Add home bottom widgets
add_action( 'genesis_loop', 'enterprise_home_bottom_widgets' );}
}function enterprise_body_class( $classes ) {
$classes[] = 'enterprise-pro-home';
return $classes;}
function enterprise_home_top_widgets() {
genesis_widget_area( 'home-top-left', array(
'before' => '<div class="home-top-left widget-area one-half first"><div class="wrap">',
'after' => '</div></div>',
) );genesis_widget_area( 'home-top-right', array(
'before' => '<div class="home-top-right widget-area one-half"><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();
March 14, 2014 at 4:41 am #94831Pixel FrauMemberThe widget areas are first defined in functions.php.
//* Register widget areas genesis_register_sidebar( array( 'id' => 'home-top', 'name' => __( 'Home - Top', 'enterprise' ), 'description' => __( 'This is the top section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom', 'name' => __( 'Home - Bottom', 'enterprise' ), 'description' => __( 'This is the bottom section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'after-entry', 'name' => __( 'After Entry', 'enterprise' ), 'description' => __( 'This is the after entry widget area.', 'enterprise' ), ) );
Change home-top:
genesis_register_sidebar( array( 'id' => 'home-top', 'name' => __( 'Home - Top', 'enterprise' ), 'description' => __( 'This is the top section of the homepage.', 'enterprise' ), ) );
to this:
genesis_register_sidebar( array( 'id' => 'home-top-left', 'name' => __( 'Home - Top Left', 'enterprise' ), 'description' => __( 'This is the top left section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-top-right', 'name' => __( 'Home - Top Right', 'enterprise' ), 'description' => __( 'This is the top right section of the homepage.', 'enterprise' ), ) );
Then take a look at this line in front-page.php:
if ( is_active_sidebar( ‘home-top’ ) || is_active_sidebar( ‘home-bottom’ ) ) {
This is saying to display 'home-top' and 'home-bottom' if they are active sidebars (widget areas). Since 'home-top' no longer exists, you need to change this to say:
if ( is_active_sidebar( ‘home-top-left’ ) || is_active_sidebar( ‘home-top-right’ ) || is_active_sidebar( ‘home-bottom’ ) ) {
September 26, 2014 at 11:34 am #125837TimMemberThanks Julia, worked perfect for me.
October 24, 2014 at 8:25 am #128972KentParticipantHi all. I tried this and it's just not working for me. I dunno what I missed.
My functions.php code:
//* Register widget areas genesis_register_sidebar( array( 'id' => 'home-top-left', 'name' => __( 'Home - Top Left', 'enterprise' ), 'description' => __( 'This is the top left section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-top-right', 'name' => __( 'Home - Top Right', 'enterprise' ), 'description' => __( 'This is the top right section of the homepage.', 'enterprise' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom', 'name' => __( 'Home - Bottom', 'enterprise' ), 'description' => __( 'This is the bottom section of the homepage.', 'enterprise' ), ) );
My front-page.php code:
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-left' ) || is_active_sidebar( 'home-top-right' ) || is_active_sidebar( 'home-bottom' ) ) { //* Force full-width-content layout setting add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); //* Add enterprise-pro-home body class add_filter( 'body_class', 'enterprise_body_class' ); //* Remove the default Genesis loop remove_action( 'genesis_loop', 'genesis_do_loop' ); //* Add home top widgets add_action( 'genesis_after_header', 'enterprise_home_top_widgets' ); //* Add home bottom widgets add_action( 'genesis_loop', 'enterprise_home_bottom_widgets' ); } } function enterprise_body_class( $classes ) { $classes[] = 'enterprise-pro-home'; return $classes; } function enterprise_home_top_widgets() { genesis_widget_area( 'home-top-left', array( 'before' => '<div class="home-top-left widget-area"><div class="wrap">', 'after' => '</div></div>', ) ); genesis_widget_area( 'home-top-right', array( 'before' => '<div class="home-top-right 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();
Any thoughts? As it is, it breaks my homepage at my site http://www.kiersdev.com/pnbc1/
Is it because I haven't designated styles for the home-top-left and home-top-right widgets in my css?
Dad. Biker. Designer. | kentfackenthall.com
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.