Reorder Wordpress Widgets using Action Hooks.

Hello, I  have a Wordpress theme, on this theme I would like to reorder the some front page Widgets.  For a visual representation of the Widgets please see Webpage.jpg.  I would like to swap A with B.

The code below shows my home-template.php (I have also attached this page).

I have numbered the Hooks from 1 - 6.  I would like to reorder number 4 with number 6.   I can reorder all of the Hooks using priority, apart from number 4 (why is this?).
* Template Name: Home Page
*/
do_action( 'genesis_home' );
//* Force full-width-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

**// Execute Home Top - Slider image  1**

add_action( 'genesis_after_header', 'wsm_home_top');
function wsm_home_top() {
	genesis_widget_area( 'slider', array( 'before' => '<div class="home-slider widget-area">', 'after' => '</div>') );
}

**// Execute Home Top - Additional News Banner 2**

add_action( 'genesis_after_header', 'wsm_home_featured', 15 );
function wsm_home_featured() {
	genesis_widget_area( 'home-top-featured', array( 'before' => '<div class="home-top-featured widget-area"><div class="wrap">', 'after' => '</div></div>') );
}

**// Remove the standard loop 3**
remove_action( 'genesis_loop', 'genesis_do_loop' );

**// Execute Home Mid Section - Three layer widget section 4**

add_action( 'genesis_loop', 'wsm_home_loop_helper' );
function wsm_home_loop_helper() {
	echo'<div class="home-mid widget-area">';
	genesis_widget_area( 'home-mid-left', array( 'before' => '<div class="mid-left widget-area">', 'after' => '</div>') );
	genesis_widget_area( 'home-mid-center', array( 'before' => '<div class="mid-center widget-area">', 'after' => '</div>') );
	genesis_widget_area( 'home-mid-right', array( 'before' => '<div class="mid-right  widget-area">', 'after' => '</div>') );
	echo'</div >';
}

**// Execute Home Bottom - Contact banner 5**

add_action( 'genesis_before_footer', 'caroline_home_bottom_cta', 5 );
function caroline_home_bottom_cta() {
genesis_widget_area( 'home-mid-cta', array( 'before' => '<div class="home-mid-cta widget-area"><div class="wrap">', 'after' => '</div></div>') );
}

**// Execute Home Bottom Section - Four post layer 6**

add_action( 'genesis_before_footer', 'caroline_home_bottom', 8 );
function caroline_home_bottom() {
	genesis_widget_area( 'home-bottom', array( 'before' => '<div class="home-bottom widget-area"><div class="wrap">', 'after' => '</div></div>') );
}
genesis();

Open in new window


Thanks for your assistance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial