Remove Primary Sidebar from Edcuation Home Page only

Community Forums Forums Design Tips and Tricks Remove Primary Sidebar from Edcuation Home Page only

This topic is: resolved

This topic contains 12 replies, has 4 voices, and was last updated by  jbculp 9 months, 1 week ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #24092

    xtego
    Participant
    Post count: 8

    Hello.  I am using the Education child theme using the latest posts option for the home page.  What I need to be able to do is remove/hide the  primary sidebar widget from the Home page only and make the blog area on the homepage full width.  I still need all of the other widgets on the home page.  (Secondary, intro, slider, featured, etc.)  And, I still need to the primary sidebar to show on all other pages.  I’m hoping this is easier than I am making it out to be, but I just can’t seem to figure it out.

    Thanks in advance!

    #24098

    Kraft
    Participant
    Post count: 86

    It is pretty easy, I believe.

    Does adding this code to your home.php file do it for you?

    https://gist.github.com/kraftbj/5084917


    Brandon Kraft
    Volunteer
    Blog | Twitter | Business
    Genesis eNews Extended Support

    #24119

    xtego
    Participant
    Post count: 8

    Thanks for the response.  That does force full width, however, it also removes the secondary sidebar which i still need.  Really i just need to hide the Primary sidebar from the home page and extend the blog text over the area where the primary sidebar is.

    To maybe better explain what I am trying to do… if you look at the education theme demo.  On the demo homepage, everything above the “join our newsletter” orange ribbon should stay the same.  Below the ribbon, I want to hide the primary sidebar (Search, tweets, profile, etc) and use that whole area for the blog entries.

    I’m thinking this will be more of a CSS change perhaps?

     

    (Also, I can’t switch the location of the primary and secondary sidebars because they are relied on on other pages.  )

    #24124

    Kraft
    Participant
    Post count: 86

    Ah, I’m following you. I’d do both php and css… just hiding the primary sidebar would still require the server to produce it and your user to download it.

    In style.css, try adding a:
    body.home #content {
    width: 880px;
    }

    (may need width: 880px !important;)

    In home.php, add remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); before genesis();

    That remove the sidebar and then increases the content space to fill the gap.


    Brandon Kraft
    Volunteer
    Blog | Twitter | Business
    Genesis eNews Extended Support

    #24154

    xtego
    Participant
    Post count: 8

    Dude!  That’s worked perfectly.  Exactly what I was looking for.  Thank you!

    #24568

    Turnlane
    Participant
    Post count: 17

    I am working on http://www.kindreddfw.com which is using the Education theme.  I am trying to remove the blog and the primary sidebar.  I was able to remove the blog roll, but am not able to remove the primary sidebar.

    I added to the home.php:

    remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );

    but it didn’t do the trick.  Any advice?

    Thanks, Julie

    #25602

    Kraft
    Participant
    Post count: 86

    Hi Julie,

    My apologies for the delayed response. It’s usually best to start a new thread when posting an issue—this one was a bit “buried” since the original poster’s issue was resolved.

    It looks like you were able to resolve this issue? If you’re still having issue, please let me know.

    Cheers!


    Brandon Kraft
    Volunteer
    Blog | Twitter | Business
    Genesis eNews Extended Support

    #29681

    Turnlane
    Participant
    Post count: 17

    Brandon,

    I have not been able to resolve the issue yet.  Please see http://www.kindreddfw.com.  I am trying to remove the blog completely.  Do I need to start a new thread?

    Thanks,

    Julie

    #29706

    Kraft
    Participant
    Post count: 86

    I’m sorry—I don’t understand what you’re trying to remove.

    It looks to me that there isn’t a blog on that site.


    Brandon Kraft
    Volunteer
    Blog | Twitter | Business
    Genesis eNews Extended Support

    #30429

    Turnlane
    Participant
    Post count: 17

    Kraft,

    I am sorry for the confusion.  I am working on http://www.kindreddfw.com which is using the Education theme.  I am trying to remove the blog and the primary sidebar.  I was able to remove the blog roll, but am not able to remove the primary sidebar.

    I added to the home.php:

    remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );

    but it didn’t do the trick.  Any advice?

    Thanks, Julie

    #30434

    Kraft
    Participant
    Post count: 86

    Julie,

    That code is working for me, though, depending on where you copied it from, it may be malformatted. Single-quotes must be the traditional single-quotes and not the “fancy” counterpart. See here:

    https://gist.github.com/kraftbj/5221737

    Using the first code, I can remove it from a stock version of Education without issue (ref: http://sp.brandonkraft.net as of now).

    Thanks,

    Brandon


    Brandon Kraft
    Volunteer
    Blog | Twitter | Business
    Genesis eNews Extended Support

    #30452

    Turnlane
    Participant
    Post count: 17

    Brandon,

    I copied the code from https://gist.github.com/kraftbj/5221737 and replaced my existing code, but I still got the same result.  The primary sidebar is still there.

    Let me know if you think of anything else I should try.

    Thanks,  Julie

    #50559

    jbculp
    Participant
    Post count: 117

    Hi all. I have two other unanwsered posts on this topic but now with your help and the help of info on a blog, I’ve got it.

    Summary:
    Remove primary sidebar from Education Theme Home page only and then widen the content frame to fill the open space.

    Since I was able to make other pages full-width, I didn’t need to do this elsewhere and I needed to retain the primary sidebar on the blog page. Had I needed the secondary-sidebar I would have followed the tutorials listed below to do a custom body class for other pages thereby allowing me to eliminate the primary sidebar where I needed.

    Full Solution in Education Theme:

    Add this to home.php
    /** Remove default sidebar */
    remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );

    With the help of Kraft in this thread and comments on this blog ( http://www.carriedils.com/genesis-theme-tutorial-primary-sidebar/ ) it all came together.

    Once sidebar is gone from home page, the content frame is too narrow. I wanted it to fill the full frame so I added this to the CSS:

    #home-featured ~ #content {width: 90%;}

    According to Chris Coyier’s website on CSS-Tricks, this selector allows for styling the content frame if it is preceded by the home-featured element. See full article at: http://css-tricks.com/child-and-sibling-selectors/.

    Yahoo!

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

You must be logged in to reply to this topic.