How to display WooCommerce sidebar on top on mobile?

When you enable WooCommerce sidebar on a shop, cart, checkout page and/or single product page, the sidebar is displayed in a secondary container.

What is a secondary container?

Basically, a container is where the main content and information appears. In general, omit the header and footer part of the website and what remains is the container. The content area and the sidebar are parts of the container. The content area is technically called as the primary container, whereas the sidebar is the secondary container.

On mobile devices, the primary container stacks on a secondary container. So, the secondary container is displayed below the primary container.

If you wish to display the sidebar above the primary container on mobile, you would need to use custom CSS code. Necessary CSS code is mentioned below for both sidebars.

For Left Sidebar-

For Right Sidebar-

Where can I put this custom CSS code?

You can insert this CSS in two ways-

  1. In Customizer: From WordPress backend navigate to Appearance > Customize > Additional CSS  and add a code the custom CSS area. (Recommended) OR
  2. Through child theme’s style.css: Edit child theme’s style.css and add a required CSS.

Other useful links-

  1. How to Install Astra Child Theme?
  2. How to edit style.css in a child theme? 

 

 

Not the solution you are looking for? Check other articles, or open a support ticket.