Hi guys! Need some support!
I’m using version 9.5 of the Newspaper theme and I see that there’s an option to show or hide the sidebar on Woocommerce pages in the admin panel:
Template settings > WooCommerce template > Shop homepage + Archives
However I need to remove (not hide) the sidebar only from specific top-level archive pages via some code in functions.php or so… The sidebar has to stay on the child-level archives. How can I do this?
Thanks!
Hello !
This should work using CSS: .page-id .woocommerce-page #content .single_wrap {
float: none;
width: 100%;
}
.page-id .woocommerce-page #sidebar {
display: none;
}
The code must be inserted here: https://www.screencast.com/t/J1Nxw5s5
Please try this css code and let us know the result !
-
This reply was modified 5 years by
Vlad S.
I added the code you provided in the respective field, but nothing changes.
Here’s a top-level archive page where I’d like to remove the sidebar and stretch the other content to fill the empty space. The content has been created using a table in the admin. I can make 3 instead of 2 cells with thumbnails per row and it will fit perfectly on the place of the sidebar: bit.ly/3d0d8T2
At the same time, here’s a child of that top-level category that needs to keep it’s sidebar: bit.ly/2MIBdDb
Thank you for your help!
Hello !
I have edited the code a bit: .term-190 .td-container .td-pb-span8 {
width: 100%;
}
.term-190 .td-container .td-pb-span4 {
display: none;
}
You will need to inspect the page you want and add the term to your code: https://www.screencast.com/t/LMXZnVIs
You will have to add this code to each TERM you want to edit.
I hope this was helpful !
Thank you !
That works! If I wish to use it on 2 different top-level categories, how should I edit it? Is it like this:
.term-190 .td-container .td-pb-span8 {
width: 100%;
}
.term-190 .td-container .td-pb-span4 {
display: none;
}
.term-200 .td-container .td-pb-span8 {
width: 100%;
}
.term-200 .td-container .td-pb-span4 {
display: none;
}
I can see this code works, but is this the right way?
One last thing – is it possible to remove the product loop from these same pages?
If possible, not to hide the products, but remove them so that the top-level category doesn’t link to the separate products and their thumbnails don’t load on page load. This is needed for SEO purposes.
Thanks!
p.s. Please remove your screenshot. Thanks.