astralogo01

Remove sidebar and make shop pages wider with Astra WordPress theme

I had an issue with the Astra wordpress theme and my Woocommerce store pages. I was stuck with a sidebar that I wasn’t using. Astra sent me the following code to remove the sidebar:

add_filter( 'astra_page_layout', 'no_sidebar_shop_page' );
function no_sidebar_shop_page( $sidebar ) {
if ( is_shop() ) {
$sidebar = 'no-sidebar';
}
return $sidebar;
}

This is to go into the functions.php file – create a child theme first.

This did that job but the content was too far over to the left and the sidebar space was still there.  I searched online and found this code:

body.woocommerce div#primary {
width: 100%;
}

body.woocommerce div#secondary {
display: none;
}

And to remove the page titles use code:

.page-title{display:none;}

Similar Posts