• Home
  • Blog
  • Showcase
  • Setup Docs
    • Sunshine Help
    • Flex Help
  • Support
    • Support Area
    • Contact us
    • Feedback
  • Connect
    • Newsletter
    • Twitter
    • Facebook
  • My Account
  • Flex
  • Sunshine
Support : Simple Pro Themes

Support : Simple Pro Themes

Reply To: Add Section To Home Page

If you have purchased a product, please enter the email address that you used to register at time of purchase.
Log In
Lost Password

Create an Account
  • Your username must be unique, and cannot be changed later.
  • We use your email address to email you a secure password and verify your account.

Support › Forums › Flex Theme › Add Section To Home Page › Reply To: Add Section To Home Page

July 14, 2016 at 1:56 pm #1103
Chinmoy Paul
Moderator

Add this code in your functions.php file. It will create the new widget area “Home Middle 2”.

genesis_register_sidebar( array(
	'id'          => 'home-middle-2',
	'name'        => __( 'Home Middle 2', 'flex' ),
	'description' => __( 'This is the home middle 2 section.', 'flex' ),
) );

Now open the front-page.php file and find this function “flex_home_middle_bottom_widget_area” . Replace the all codes of that function with this new code:

function flex_home_middle_bottom_widget_area() {

  if( is_active_sidebar('home-middle') ):
    
    	genesis_widget_area( 'home-middle', array(
    		'before' => '<div class="home-middle" id="home-middle">',
    		'after'  => '</div>',
    	) );
    
  endif;
  
  if( is_active_sidebar('home-middle-2') ):
    
    	genesis_widget_area( 'home-middle-2', array(
    		'before' => '<div class="home-middle-2" id="home-middle-2">',
    		'after'  => '</div>',
    	) );
    
  endif;

  if( is_active_sidebar('home-bottom-left') || is_active_sidebar('home-bottom-right') ):
  
    printf( '<div %s>', genesis_attr( 'home-bottom' ) );
    
    	genesis_widget_area( 'home-bottom-left', array(
    		'before' => '<div class="home-bottom-left">',
    		'after'  => '</div>',
    	) );
      
      genesis_widget_area( 'home-bottom-right', array(
    		'before' => '<div class="home-bottom-right">',
    		'after'  => '</div>',
    	) );
      
    echo '</div>' . "\n";
    
  endif;
 
}

Note: Before editing the files you will keep a backup of your child theme.

Copyright © 2021 · Simple PRO Themes for Genesis Framework · About · FAQs · Contact · Affiliates