• 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

[Resolved] 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

  • This topic has 2 replies, 2 voices, and was last updated 4 years, 6 months ago by genunlimited.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • July 13, 2016 at 10:39 pm #1090
    genunlimited
    Participant

    I need to add a section to my home page under the home page middle, like “Home Page Middle 2” or something. Is there ay instructions on how to add this in the php files?

    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.

    July 14, 2016 at 2:28 pm #1106
    genunlimited
    Participant

    Awesome! Thank YOU!!!

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

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