I have a blog with a sidebar on the right and in the rest of the web, the sidebar should not appear. On the web I also have the woocommerce for purchases. The strange thing is that in the individual pages of each product, the sidebar appears just below the images of the products BUT on the left.
This bar should not appear anywhere other than the blog. I have looked at the settings a thousand times and there is nothing to indicate a sidebar to the left (only to the right and in the blog).
So after all this, I decided to get into the .php files of the woocommerce with the hope of eliminating it from there ... and I should have deleted it, but the bar continues.
I went to single-product.php and deleted this code
<?php
/**
* woocommerce_sidebar hook
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action('woocommerce_sidebar');
?>
After deleting it, I went to archive-product.php and deleted the following:
<?php
/**
* woocommerce_sidebar hook
*
* @hooked woocommerce_get_sidebar - 10
*/
do_action('woocommerce_sidebar');
?>
Finally, I went to the usual css of my wordpress and added the following rule:
#content-woocomerece{
width:100% !important;
}
The! important I added it later when seeing that it did not take effect, but neither with those the bar disappears. I also tried the following (replacing the previous css rule with this one) but it did not work either:
.woocommerce #sidebar{display:none;}
I also tried to put the following functions in the functions.php without success:
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
With CSS I made the sidebar invisible with visibility: hidden only in the store bar (the corresponding sidebar continued in the blog) but the problem is that it occupies a lot of that sidebar and leaves a huge blank space ( why I want to remove it, since it disfigures the store and above having nothing useful for the store, it takes up a lot of space and the rest leaves it blank).
aside.sidebar.sidebar_sidebar_right.alpha.units{
visibility:hidden;
}
I do not know what else to try (the only line I saw in sidebar.php related to woocommerce did not help to eliminate it, so I put it back).
I will appreciate it very much if someone can help me. I leave an image of how it looks and the bar that needs to be deleted: