Community Forums › Forums › Archived Forums › Design Tips and Tricks › Changing the order of Front Page 3 and 4
- This topic has 3 replies, 3 voices, and was last updated 6 years, 7 months ago by mrlennyman.
-
AuthorPosts
-
September 12, 2017 at 10:39 am #211359mrlennymanMember
Hi there,
I am using the Boos Pro theme and would like to change the order of the Front Page 3 and 4 widgets.
Or alternatively, apply the functionality of 3 to 4 and vice versa.
Is there a simple work around for this using Genesis Hooks or somethign along those lines?Mamy thanks if anyone can be of help 🙂
http://testsite.wholeheartedhealing.org
Cheers
JohnSeptember 12, 2017 at 2:50 pm #211376ErikaParticipantHi Lenny,
What you can do is swap the CSS tags. So everything that says .front-page-4 (or something along those lines) change to .front-page-3 and vice versa. See if that helps you swap the functionality.
September 12, 2017 at 4:35 pm #211381Victor FontModeratorChanging the display position of the widget areas requires editing front-page.php. In Boss Pro, this means editing the boss_front_page_widgets() function that starts wt line 53 in front-page.php. This is the code in that file as delivered that displays front page 3 and 4:
genesis_widget_area( 'front-page-3', array( 'before' => '<div id="front-page-3" class="front-page-3 flexible-widget-area"><div class="wrap"><div class="flexible-widgets widget-area' . boss_widget_area_class( 'front-page-3' ) . '">', 'after' => '</div></div></div>', ) ); if ( is_active_sidebar( 'front-page-4' ) ) { $image = get_option( 'boss-front-page-image-2', sprintf( '%s/assets/images/demo-02.jpg', get_stylesheet_directory_uri() ) ); $background_image = 'style="background-image: url(' . $image . ')"'; $background_image_class = $image ? 'with-background-image' : ''; ?> <div id="front-page-4" class="front-page-4 bg-primary <?php echo $background_image_class; ?>" <?php echo $background_image; ?>> <div class="wrap"> <?php genesis_widget_area( 'front-page-4', array( 'before' => '<div class="widget-area">', 'after' => '</div>', ) ); ?> </div> </div> <?php }
With the areas swapped, the code looks like this:
if ( is_active_sidebar( 'front-page-4' ) ) { $image = get_option( 'boss-front-page-image-2', sprintf( '%s/assets/images/demo-02.jpg', get_stylesheet_directory_uri() ) ); $background_image = 'style="background-image: url(' . $image . ')"'; $background_image_class = $image ? 'with-background-image' : ''; ?> <div id="front-page-4" class="front-page-4 bg-primary <?php echo $background_image_class; ?>" <?php echo $background_image; ?>> <div class="wrap"> <?php genesis_widget_area( 'front-page-4', array( 'before' => '<div class="widget-area">', 'after' => '</div>', ) ); ?> </div> </div> <?php } genesis_widget_area( 'front-page-3', array( 'before' => '<div id="front-page-3" class="front-page-3 flexible-widget-area"><div class="wrap"><div class="flexible-widgets widget-area' . boss_widget_area_class( 'front-page-3' ) . '">', 'after' => '</div></div></div>', ) );
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?September 13, 2017 at 3:47 pm #211419mrlennymanMemberThank you Victor and Erika...
I tried your suggestion Victor and it has worked perfectly.
I appreciate you taking the time to help!
Cheers
John -
AuthorPosts
- The topic ‘Changing the order of Front Page 3 and 4’ is closed to new replies.