Community Forums › Forums › Archived Forums › General Discussion › Sidebar on Home Page
Tagged: home page, Minimum theme, Sidebar
- This topic has 3 replies, 4 voices, and was last updated 12 years, 6 months ago by
Robert Neu.
-
AuthorPosts
-
July 14, 2013 at 1:19 am #50598
Suzanneper
MemberI took out the social media widgets on the home page of the Minimum theme and suddenly my sidebar appeared on my home page. It wasn't there before but only on the individual pages. How can I make it disappear again?
http://www.strandsofmylife.com/July 14, 2013 at 5:06 am #50604AnitaC
KeymasterIf it were my website, instead of deleting the social buttons - you can drag a text widget into Widget 1, save it. Then go to Style.css and add this:
#home-featured { display: none: }This way if you ever want to use that area, all you have to do is remove this from the CSS and it's back again. Someone more experienced with the PHP would have to respond on how to delete it completely from your theme.
Need help with customization or troubleshooting? Reach out to me.
July 14, 2013 at 7:52 am #50623Doak Heggeness
MemberIf you are not using the four widgets on the home.php, it reverts back to the 'default loop.' You can do what anitac suggests or delete the following from home.php. You are deleting the four widgets from the home.php`add_action( 'genesis_meta', 'minimum_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function minimum_home_genesis_meta() {if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) || is_active_sidebar( 'home-featured-4' ) ) {
add_action( 'genesis_after_header', 'minimum_home_featured', 15 );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
add_filter( 'body_class', 'minimum_add_body_class' );function minimum_add_body_class( $classes ) {
$classes[] = 'minimum';
return $classes;
}}
}function minimum_home_featured() {
echo '<div id="home-featured"><div class="wrap">';
genesis_widget_area( 'home-featured-1', array(
'before' => '<div class="home-featured-1 widget-area">',
) );genesis_widget_area( 'home-featured-2', array(
'before' => '<div class="home-featured-2 widget-area">',
) );genesis_widget_area( 'home-featured-3', array(
'before' => '<div class="home-featured-3 widget-area">',
) );genesis_widget_area( 'home-featured-4', array(
'before' => '<div class="home-featured-4 widget-area">',
) );echo '</div><!-- end .wrap --></div><!-- end #home-featured -->';
}
You will need to add back in the following to keep the full width content: 'add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );' So your home.php will now look like:<?php
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );add_action( 'genesis_loop', 'minimum_grid_loop_helper' );
function minimum_grid_loop_helper() {if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 0,
'feature_image_size' => 'featured',
'feature_image_class' => 'post-image',
'feature_content_limit' => 0,
'grid_image_size' => 0,
'grid_image_class' => 'alignnone',
'grid_content_limit' => 250,
'more' => __( '[Read more]', 'minimum' ),
) );
} else {
genesis_standard_loop();
}}
genesis();`
Doak Heggeness, WordPress Development | Website
July 14, 2013 at 9:31 am #50633Robert Neu
MemberThere's really no need to delete all that code. Since you're not that familiar with PHP, deleting the code will probably make it difficult for you to restore the original functionality of the theme if you change your mind.
In order to prevent the widget area from loading, all you need to do is comment out the action which loads the widgeted areas. You can do that by adding two forward slashes in front of it like this:
// add_action( 'genesis_after_header', 'minimum_home_featured', 15 );Doing this will prevent the mimimum_home_featured area from loading. If you change your mind later it'll be very easy for you to go back and turn it back on. All you'll need to do is delete the slashes and you'll be back in business.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.