[Resolved] No sidebars in tablet and mobile widths in woocommerce shop pages

Home Forums Support [Resolved] No sidebars in tablet and mobile widths in woocommerce shop pages

Home Forums Support No sidebars in tablet and mobile widths in woocommerce shop pages

  • This topic has 9 replies, 3 voices, and was last updated 4 years ago by David.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1233033
    Fernando Díaz Gascón

    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

    #1233087
    Leo
    Staff
    Customer Support

    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/

    #1233531
    Fernando Díaz Gascón

    It does not work to me, I dont know why.

    You can see here

    The web is https://mariamandarinaonline.es and a shop page, for example, https://mariamandarinaonline.es/categoria-producto/alimentacion/

    Thank you

    #1233867
    David
    Staff
    Customer Support

    Hi there,

    try this:

    @media (max-width: 768px) {
        .woocommerce.archive #left-sidebar {
            display: none;
        }
    }
    #1234848
    Fernando Díaz Gascón

    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

    #1235031
    David
    Staff
    Customer Support

    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

    #1235484
    Fernando Díaz Gascón

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

    #1236340
    David
    Staff
    Customer Support

    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;
        }
    }
    #1236348
    Fernando Díaz Gascón

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

    #1236368
    David
    Staff
    Customer Support

    You’re welcome

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.