Sidebar on Home Page

Community Forums Forums General Discussion Sidebar on Home Page

This topic is: not resolved

This topic contains 3 replies, has 4 voices, and was last updated by  Robert Neu 1 year ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #50598

    Suzanneper
    Participant
    Post count: 45

    I 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/
    #50604

    anitac
    Participant
    Post count: 7031

    If 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:

    [css]#home-featured {
    display: none:
    }[/css]

    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.


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #50623

    Doak Heggeness
    Participant
    Post count: 140

    If 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

    #50633

    Robert Neu
    Participant
    Post count: 90

    There’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.


    Co-Founder of Audit WP, a WordPress SEO audit service and Flagship, a new WordPress theme company launching soon!

    • This reply was modified 1 year ago by  Robert Neu.
    • This reply was modified 1 year ago by  Robert Neu.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.