Moving the front page 1 widget area above the site header on Home Page of Altitude Pro Theme

Step 1:

Removing the code of front page 1 widget areas from altitude_front_page_widgets() function. This function is locating in front-page.php file.

 genesis_widget_area( 'front-page-1', array(
		'before' => '<div id="front-page-1" class="front-page-1"><div class="image-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-1' ) . '"><div class="wrap">',
		'after'  => '</div></div></div></div>',
	) );

Step 2:

Creating an new function and putting the above code in this function. Here is the complete code of that function. You will add this function above the genesis() function of front-page.php file

function altitude_front_page_section_1() {
  genesis_widget_area( 'front-page-1', array(
		'before' => '<div id="front-page-1" class="front-page-1"><div class="image-section"><div class="flexible-widgets widget-area' . altitude_widget_area_class( 'front-page-1' ) . '"><div class="wrap">',
		'after'  => '</div></div></div></div>',
	) );
}

Step 3:

Now I am moving the front page 1 widget area above the <header> markup. So I chose the “genesis_header” hook. Using this same hook Genesis Framework is loading the opening structural markup for the header. Priority of the opening markup of <header> HTML5 tag is 5. So I am using the priority 3 and it will call the altitude_front_page_section_1() function before the genesis_header_markup_open() function.

Put this single line of code just below the if ( is_active_sidebar( ‘front-page-1’ ) ) { statement.

add_action( 'genesis_header', 'altitude_front_page_section_1', 3 );

Step 4:

Add this new code in your style.css file

.home .site-header {
	position: relative;
}

Share This Article

Subscribe Membership Plan ($9.99/mo)

  • Get full access to all premium tutorials
  • Get Support for the posted content
  • Request for specific how-to tutorials
  • Cancel the subscription at anytime

Reader Interactions

Leave A Reply

Your email address will not be published. Required fields are marked *