Hi @mmk175
Please note that writing or providing custom code is not within the scope of our support policy. However, to remove the sidebar from the single product page, you can add this custom code snippet to your child theme’s functions.php: https://gist.github.com/shameemreza/13e13e0f5d77da24230f3fe5e74e1c67
add_action( 'get_header', 'srdev_remove_storefront_sidebar' );
function srdev_remove_storefront_sidebar() {
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}
Additionally, consider using the Widget Options plugin to hide from categories or other pages. It gives you superpowers to control your site’s sidebar widgets and all Gutenberg blocks on pages & posts.
I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.
Thread Starter
mmk175
(@mmk175)
Hi @shameemreza
I understand and very much appreciate your help.
I will have to do a little digging on how to add this to my child theme as I don’t see anything like this listed in the “theme file editor”.
Question: Does this code remove the side bar completely or from all pages or just ones I have left “blank”.
That plugin seems like a good idea. I will be checking it out later but the link seems broken. That plugin seems like a good idea. I will be checking it out later but the link seems broken.
I get about:blank#blocked when clicking it.
Hi @mmk175
Does this code remove the side bar completely or from all pages or just ones I have left “blank”.
That code snippet will remove the sidebar entirely from the single product page, like this one: https://matthewm288.sg-host.com/product/100-bible-stories-for-children-44891/
It will be remain as it is on other location like this one: https://matthewm288.sg-host.com/tin-prayer-boxes/
However, if you’re looking to hide the sidebar only for a specific single product page, instead of removing it completely, you’ll need to use a particular plugin or a custom CSS.
That plugin seems like a good idea. I will be checking it out later but the link seems broken. That plugin seems like a good idea. I will be checking it out later but the link seems broken.
Oops, apologies. It seems I didn’t paste the link correctly. Here’s the correct link: https://wordpress.org/plugins/widget-options/
I hope this helps! If you have any other questions, feel free to ask.
Thread Starter
mmk175
(@mmk175)
Hi @shameemreza
Awesome. Thank you for helping understand this better. If I could give you five stars I would.
That plugin looks like it will do what I need. Loads to sort out on the site at the moment.
Thanks again.
Hi @mmk175,
Thanks for getting back to us. We are glad to help! Just so you know – we will now close this ticket as solved. If you have a few minutes, we’d love if you could leave us a review here.
If you have any other questions or issues, please feel free to open a new ticket and we’ll be happy to assist you.
Thank you for choosing WooCommerce and have a great day!