Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove Primary Sidebar from Edcuation Home Page only
Tagged: education, home, primary sidebar, remove sidebar
- This topic has 12 replies, 4 voices, and was last updated 11 years, 2 months ago by jbculp.
-
AuthorPosts
-
March 4, 2013 at 1:16 pm #24092xtegoMember
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!
March 4, 2013 at 1:45 pm #24098KraftMemberIt 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
Genesis eNews Extended SupportMarch 4, 2013 at 2:53 pm #24119xtegoMemberThanks 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. )
March 4, 2013 at 3:20 pm #24124KraftMemberAh, 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' );
beforegenesis();
That remove the sidebar and then increases the content space to fill the gap.
Brandon Kraft
Volunteer
Blog | Twitter
Genesis eNews Extended SupportMarch 4, 2013 at 5:01 pm #24154xtegoMemberDude! That's worked perfectly. Exactly what I was looking for. Thank you!
March 6, 2013 at 11:51 am #24568TurnlaneMemberI 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
March 12, 2013 at 12:06 am #25602KraftMemberHi 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
Genesis eNews Extended SupportMarch 20, 2013 at 7:57 am #29681TurnlaneMemberBrandon,
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
March 20, 2013 at 9:20 am #29706KraftMemberI'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
Genesis eNews Extended SupportMarch 22, 2013 at 8:05 am #30429TurnlaneMemberKraft,
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
March 22, 2013 at 8:39 am #30434KraftMemberJulie,
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
Genesis eNews Extended SupportMarch 22, 2013 at 10:00 am #30452TurnlaneMemberBrandon,
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
July 13, 2013 at 12:32 pm #50559jbculpParticipantHi 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!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.