Simplest way to remove sidebar on all page/post types
WPMU DEV Community
Simplest way to remove sidebar on all page/post types
Elite
60 pointsSerious WPMU DEV-sterI'm new here
godot
Member
—
15th January 2012 (4 months ago)
I've created a child theme and added some custom CSS and whatnot, but my knowledge is too limited to understand the simplest way to make all posts, pages, bp components, and custom taxonomies full-width. Can anyone help me out with this?
I've created a child theme and added some custom CSS and whatnot, but my knowledge is too limited to understand the simplest way to make all posts, pages, bp components, and custom taxonomies full-width. Can anyone help me out with this?
Let me tack a second question onto this same topic --
I want to create custom category archives but I'm afraid my WP knowledge isn't sophisticated enough to understand the directory structure of this theme. I don't see any category.php or archive.php. What files control the output onto category archive pages?
1284 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Lifetime Member
—
15th January 2012 (4 months ago)
#
Hi godot,
simplest way to make all posts, pages, bp components, and custom taxonomies full-width
Can you provide a link to your site? It would be much easier this way to help you with your sidebar layout.
What files control the output onto category archive pages?
Copy blogs-mu/index.php to your /blogs-mu-child/ folder and scroll to where you see the following: <div class="post-content">
You'll see how the archive pages are set up. For example, if you want to add archives for categories, simply change the first if statement to: <?php if( is_date() || is_search() || is_tag() || is_author() || is_category()) { ?>
Hope this helps! :-)
1284 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Lifetime Member
—
16th January 2012 (4 months ago)
#
Hi again godot,
There's a small error in Richie's css above: a closing ")" instead of "}". But, for the most part, it should work for everything blog-related. Here's the css to remove the sidebar from everything you stated above, including Buddypress components:
Well this is odd... I had removed the CSS from my child theme for a while to consider whether the sidebar might be useful, but decided against it. But now when I add the CSS to my child theme's style.css file, and/or to its inc/css/child-style.css (what'd the difference between these, anyway?) nothing changes at all!.
How could it be that the code worked before, but not now??
@godot
best input the custom css into inc/css/child-style.css
style.css maybe overwrite if new version released.
But now when I add the CSS to my child theme's style.css file, and/or to its inc/css/child-style.css (what'd the difference between these, anyway?) nothing changes at all!.
check your site source code and see if the child-style.css were properly call in header
I even tried installing the Custom CSS Manager plugin and having it insert the CSS code, to make sure. I then viewed the page in an alternate browser to make sure caching was not an issue. I tried both pcwriter's CSS and Richie_KS's, and neither produced any change at all. How can this be?
Well, I can't really explain this, but I added pcwriter's code back into header.php before the </head> tag in a <style> block, and it's working! I had to add in some border:0px; tags.
Richie's code made the sidebar disappear but content area remained small.
Personally I hate CSS and have no idea how this is working or why it doesn't work when placed in the css file, but I'll take it.
Responses (15)
Member — 15th January 2012 (4 months ago) #
Let me tack a second question onto this same topic --
I want to create custom category archives but I'm afraid my WP knowledge isn't sophisticated enough to understand the directory structure of this theme. I don't see any category.php or archive.php. What files control the output onto category archive pages?
Geeky Developer — 15th January 2012 (4 months ago) #
hi try adding this to your base.css or child-style.css
this should make all content area full witdh without sidebar.
cheers
Member — 15th January 2012 (4 months ago) #
Thanks for your help!
I added your CSS to my child theme's style.css but it doesn't seem to have changed anything?
Lifetime Member — 15th January 2012 (4 months ago) #
Hi godot,
Can you provide a link to your site? It would be much easier this way to help you with your sidebar layout.
Copy blogs-mu/index.php to your /blogs-mu-child/ folder and scroll to where you see the following:
<div class="post-content">You'll see how the archive pages are set up. For example, if you want to add archives for categories, simply change the first if statement to:
<?php if( is_date() || is_search() || is_tag() || is_author() || is_category()) { ?>Hope this helps! :-)
Member — 16th January 2012 (4 months ago) #
The site isn't live yet, it's just running on a staging server. It's running the the BlogsMU theme though, so it should be the same on mine as at http://themetastic.com/buddypress/?wptheme=Blogs%20MU
Thanks for pointing me at the spot for the templates. I'll give it a look :)
Lifetime Member — 16th January 2012 (4 months ago) #
Hi again godot,
There's a small error in Richie's css above: a closing ")" instead of "}". But, for the most part, it should work for everything blog-related. Here's the css to remove the sidebar from everything you stated above, including Buddypress components:
Copy this code to your child-style.css file. Be sure it's after all the commented out stuff though: /*--*/
Hope this helps! :-)
Member — 17th January 2012 (4 months ago) #
Perfect! Thanks, pcwriter!
Lifetime Member — 18th January 2012 (4 months ago) #
You're very welcome!
Member — 3rd February 2012 (3 months ago) #
Well this is odd... I had removed the CSS from my child theme for a while to consider whether the sidebar might be useful, but decided against it. But now when I add the CSS to my child theme's style.css file, and/or to its inc/css/child-style.css (what'd the difference between these, anyway?) nothing changes at all!.
How could it be that the code worked before, but not now??
Geeky Developer — 3rd February 2012 (3 months ago) #
yikes thx @pcwriter
the corrent code should be
@godot
best input the custom css into inc/css/child-style.css
style.css maybe overwrite if new version released.
check your site source code and see if the child-style.css were properly call in header
Member — 3rd February 2012 (3 months ago) #
There is no reference to child-style.css in header.php. There is one in function.php, though.
I tried adding your CSS to child-style.css, and also adding it to a <style> section right above </head> in header.php and both ways gave no effect.
Support Kangaroo — 4th February 2012 (3 months ago) #
Greetings godot :-)
sir you are clearing your cache completely or using an alternative browser when checking for the changes aren't you?
Joe :-)
Member — 5th February 2012 (3 months ago) #
Sidebar still shows up in an alternate browser as well. Very confusing :/
Member — 6th February 2012 (3 months ago) #
I even tried installing the Custom CSS Manager plugin and having it insert the CSS code, to make sure. I then viewed the page in an alternate browser to make sure caching was not an issue. I tried both pcwriter's CSS and Richie_KS's, and neither produced any change at all. How can this be?
Member — 7th February 2012 (3 months ago) #
Well, I can't really explain this, but I added pcwriter's code back into header.php before the </head> tag in a <style> block, and it's working! I had to add in some border:0px; tags.
Richie's code made the sidebar disappear but content area remained small.
Personally I hate CSS and have no idea how this is working or why it doesn't work when placed in the css file, but I'll take it.
Become a member