Community Forums › Forums › Archived Forums › Design Tips and Tricks › How do I shift widget areas on Lifestyle Pro theme?
Tagged: extra home page widget, lifestyle Pro
- This topic has 6 replies, 3 voices, and was last updated 10 years, 8 months ago by
John Chadwick.
-
AuthorPosts
-
May 30, 2014 at 2:06 pm #107546
brightisland
ParticipantI'd like to be able to have the Home-Middle widget block switch places with the Home-Bottom-Left and Home-Bottom-Right widget areas on the Lifestyle Pro theme.
I don't want to add or remove any areas, just reposition them on the home page.
How would I do that?
Thanks in advance!
May 30, 2014 at 9:29 pm #107574AnitaC
KeymasterYou have to modify the front-page.php file. It might be tricky. Email me on my website and I will send you an edited version of the file. You can back up your original before loading the file you get from me.
Need help with customization or troubleshooting? Reach out to me.
May 31, 2014 at 6:25 am #107620AnitaC
KeymasterI sent you an email. I had walked away and fell asleep. I am almost finished so watch your email.
Need help with customization or troubleshooting? Reach out to me.
May 31, 2014 at 2:00 pm #107653John Chadwick
MemberI have managed to create an extra widget area on the home page underneath the bottom-left and bottom-right widgets. I had to edit the functions.php, front-page.php and the style.css. I can post a solution here if anitac has not already provided the answer?
June 3, 2014 at 8:55 pm #108029brightisland
ParticipantJohn - I think I can certainly use your solution if you wouldn't mind sharing it.
Adding a widget would accomplish what I need, while leaving the other widgets, as well. 🙂
June 5, 2014 at 12:05 pm #108187John Chadwick
MemberHi Brightisland,
I am in the middle of a build site which can be seen here. The site has been modified to add an extra widget to the home page whilst maintaining the default widgets.
You will need to edit the following files of your child theme...I have posted my new edits;
front-page.php
functions.php
style.cssEdit FRONT-PAGE.PHP by adding the emboldened code;
function lifestyle_home_genesis_meta() {
if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom-left' ) || is_active_sidebar( 'home-bottom-right' ) || is_active_sidebar( 'home-extra' ) ) {
// Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );// Add lifestyle-pro-home body class
add_filter( 'body_class', 'lifestyle_body_class' );// Remove the default Genesis loop
remove_action( 'genesis_loop', 'genesis_do_loop' );// Add homepage widgets
add_action( 'genesis_loop', 'lifestyle_homepage_widgets' );// FNB CUSTOM - add extra home page widget
add_action( 'genesis_loop', 'fnb_homepage_widgets' );}
}function lifestyle_homepage_widgets() {
genesis_widget_area( 'home-top', array(
'before' => '<div class="home-top widget-area">',
'after' => '</div>',
) );genesis_widget_area( 'home-middle', array(
'before' => '<div class="home-middle widget-area">',
'after' => '</div>',
) );if ( is_active_sidebar( 'home-bottom-left' ) || is_active_sidebar( 'home-bottom-right' ) ) {
echo '<div class="home-bottom">';
genesis_widget_area( 'home-bottom-left', array(
'before' => '<div class="home-bottom-left widget-area">',
'after' => '</div>',
) );genesis_widget_area( 'home-bottom-right', array(
'before' => '<div class="home-bottom-right widget-area">',
'after' => '</div>',
) );echo '</div>';
}
}//FNB CUSTOM - Added Home Extra widget area
function fnb_homepage_widgets() {genesis_widget_area( 'home-extra', array(
'before' => '<div class="home-extra widget-area">',
'after' => '</div>',
) );}
Edit FUNCTIONS.PHP by adding the emboldened code;
//* FNB CUSTOM - Register Home Extra Area
genesis_register_sidebar( array(
'id' => 'home-extra',
'name' => __( 'Home - Extra', 'fastnicheblogstheme' ),
'description' => __( 'This is the home page extra widget area', 'fastnicheblogstheme' ),
) );EDIT STYLE.CSS by adding;
/*FNB CUSTOM for Home Extra widget*/
.home-extra {
float:left;
}I hope the above helps
Kind Regards
John Chadwick
June 18, 2014 at 1:43 pm #110406John Chadwick
MemberHi Brightisland,
I am afraid I have had to revert the build site back to basic Lifestyle theme as that's the way teh client wants it. When I have finished the work I will set up a dummy theme and repost the code to change the widgets on the Lifestyle pro home page (front-page)
The code I have already posted will work, I just can't show it for the moment.
Kind regards
John Chadwick
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.