Site logo

Archived topic

No sidebars in tablet and mobile widths in woocommerce shop pages

9 replies · Started by Fernando Díaz Gascón on April 9, 2020

Viewing posts 1–10 of 10

Hello,
With the woocoomerce addon you can configure in the shop page if you want this with sidebars or not. I would like to have left sidebar for desktop and no sidebars for tablet and mobile. Is it possible?

Thank you

Hi there,

Just to confirm, you want this for all shop archives correct?

If so this should work:

@media (max-width: 768px) {
    body.post-type-archive-product #left-sidebar {
        display: none;
    }
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Hi there,

try this:

@media (max-width: 768px) {
    .woocommerce.archive #left-sidebar {
        display: none;
    }
}

Hi, it works, but it remove the sidebar and it leaves an ugly empty space.

See here

I would like to have no sidebars, as in mobile version.

Thank you in advance

The CSS i provided here will only apply to Tablet and Mobile - so there should be NO empty space to the side. Can you add the CSS back in and we can take a look at what the issue is

Done. I have put 1100 px of max-width.

Aah ok - if you want it to be removed at a larger width then use this CSS:

@media (max-width: 1100px) {
    .woocommerce.archive #left-sidebar {
        display: none;
    }
    #primary {
        width: 100%;
        left: unset;
    }
}

Great!! Thanks a lot. That code is perfect for me.

You're welcome

This archived topic is closed to new replies.