Community Forums › Forums › Archived Forums › General Discussion › Education – Remove Sidebar on Home
Tagged: education
- This topic has 10 replies, 5 voices, and was last updated 11 years, 11 months ago by Brad Dalton.
-
AuthorPosts
-
February 5, 2013 at 11:10 am #18237jfortenberryMember
I am setting up a site in a subfolder of the main site (http://www.trustestatelaw.net/wp/) using the Education theme. I would like to remove the sidebar and the loop from below the CTA section on the home page. I have added this code to home.php:
remove_action( 'genesis_loop', 'genesis_do_loop' );
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );That took care of the loop, but didn't eliminate the sidebar.
I also tried:
remove_action( ‘genesis_after_content’, ‘genesis_get_sidebar’ );
That didn't work either. How do I get rid of that sidebar on the homepage?
February 5, 2013 at 12:48 pm #18260SoZoMemberAdd this to your style sheet
.home #content,
.home #sidbar {
display: none;
}
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 6, 2013 at 5:07 pm #18538jfortenberryMemberThanks for the prompt response SoZo. That does work. I'm a little finicky, though, and don't really like using CSS to hide page elements. It seems a bit clunky. I'm also a little concerned about the SEO effect as that could be a bunch of hidden links. Is there a way to actually stop WordPress/Genesis from inserting the sidebar on the homepage?
Thanks again.
February 7, 2013 at 5:09 pm #18776achieve1MemberI am trying to accomplish exactly the same thing - (http://www.mississaugaribfest.ca) and am doing exactly as is outline above, except the primary sidebar will not disappear even with the css code.
I would really appreciate any help you can offer.
My goal is to have the page end just the way it does for (http://www.trustestatelaw.net/wp/)
Thanks so much
February 7, 2013 at 5:37 pm #18781jfortenberryMemberChange "sidbar" to "sidebar" in the code that SoZo gave us.
February 7, 2013 at 5:45 pm #18783achieve1MemberOh my stars!!! Thank you, thank you, thank you!!!
I've spent 2 hours trying to get it to work .
I can't tell you how much I appreciate it.
February 7, 2013 at 5:57 pm #18789PinkInkMemberSorry to butt in, but it seems I am trying to achieve something similar to this using only the Mocha theme. I've tried hiding the sidebar and content using the CSS style sheet however I can't seem to differentiate home from the entire site. Below is the CSS from the home page, as you can see it's using the same style on all pages, do you have any ideas I can try?
.content-sidebar #content-sidebar-wrap, .full-width-content #content-sidebar-wrap, .sidebar-content #content-sidebar-wrap
Tiff
February 7, 2013 at 6:07 pm #18793achieve1MemberI am far from an expert - but what I noticed was done here was adding the first bit of code to home.php and then the additional code went to the style sheet.
I think you have to change the home only on the home.php.
Does that make sense? Please understand I am not an expert, just a user but I feel your pain.
February 7, 2013 at 6:23 pm #18796PinkInkMemberHi achieve1 thank you so much for you reply, started to feel a little invisible here LOL
I've got the remove action in my home.php but it doesn't make a difference, I also tried using remove_action for the sidebar wrap although the code may not be right?
remove_action( 'genesis_before_content_sidebar_wrap', 'mocha_home_content' );
Tiff
February 8, 2013 at 7:48 am #18918achieve1MemberI don't know anything about the mocha theme - but I would think it is a child theme. Presumably you are building this based on the genesis framework, in which case you should not have to make reference to the theme (we were using education theme and there's no mention of it in the code).
I think the placement is important in the home.php, and making sure the css code is
.home #content,
.home #sidebar {
display: none;
}Unfortunately that's about the extent of my knowledge.
February 8, 2013 at 9:20 am #18931Brad DaltonParticipantHow about the width of the home page?
This will force full width if you paste it into the home.php file
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
You'll then need to edit your CSS for the home widgets
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.