Support › Forums › Flex Theme › Add Section To Home Page › Reply To: Add Section To Home Page
July 14, 2016 at 1:56 pm
#1103
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.