Innov8tive – Remove primary sidebar from homepage

Community Forums Forums Design Tips and Tricks Innov8tive – Remove primary sidebar from homepage

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  Sridhar Katakam 1 year, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #64397

    TeresaMc
    Participant
    Post count: 6

    Using the Innov8tive theme: I would like to remove the primary sidebar from the homepage only, and have the remaining widgets on the homepage go full width.

    I’ve been playing with code, but just can’t seem to get it right.

    Any suggestions? Thanks a million!

    http://playtimeandparty.com/
    #64431

    Sridhar Katakam
    Participant
    Post count: 1068

    Try this in functions.php:

    add_action ( 'genesis_meta', 'sk_full_width_homepage' );
    function sk_full_width_homepage() {
    	# Force full width content
    	add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    }

    #64478

    TeresaMc
    Participant
    Post count: 6

    Thanks for your input Sridhar!

    That code works when the homepage is in blog mode, but when I use the home top, home left, home right and home bottom widgets it reverts back the homepage with the primary sidebar.

    With that code the primary sidebar is removed from ALL posts. I just wanted it removed from the homepage but remain on the blog posts.

    Picky, aren’t I?! LOL

    #64479

    TeresaMc
    Participant
    Post count: 6

    I tried using that code in the homepage.php and it just gave me a parse error.

    #64505

    Sridhar Katakam
    Participant
    Post count: 1068

    Try using this instead:

    add_action ( 'genesis_meta', 'sk_full_width_homepage' );
    function sk_full_width_homepage() {
    	if ( is_home() || is_front_page() ) :
    		# Force full width content
    		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    	endif;
    }

    #64513

    TeresaMc
    Participant
    Post count: 6

    Works in blog mode for the homepage and leaves primary sidebar in posts – but when I activate the homepage widgets the primary sidebar appears again.

    #64514

    TeresaMc
    Participant
    Post count: 6

    How can I delete the primary sidebar from the homepage?

    #64542

    Sridhar Katakam
    Participant
    Post count: 1068

    Try adding the following inside the if condition:

    /** Remove default sidebar */
    remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );

    I do not have that theme or else I could have tested before suggesting you the code snippets.


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.