• Resolved Hjorth007

    (@hjorth007)


    Hi

    I use the Responsive Theme with woocommerce. I use the woocommerce sidebar to display a filter. Its all fine on desktop, but on mobile the sidebar falls below the products. How do I reverse the order of the products and the sidebar, so I get the sidebar on top on mobile ?

    Henrik

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @hjorth007 ,

    Unfortunately, we don’t have any plans of bringing this feature out right now as this is the desired workflow of the theme.

    I have pitched your idea to the product team, and if we get more requests around this, we will definitely consider picking this up.

    Best Regards

    Thread Starter Hjorth007

    (@hjorth007)

    Aaah, ok, I was hoping for a css-workaround to bring the sidebar to the top of the page on mobile. ??

    Thread Starter Hjorth007

    (@hjorth007)

    Found out, that a little bit of php-code, can do the trick. It goes in your child-themes functions.php or as a snippet. You may want to alter the css-id (#secondary and #primary) to the specific class or id in your own case:

    <?php
    add_action('wp_footer', 'wpsf_move_sidebar', 100);
    function wpsf_move_sidebar()
    { ?>
      <script>
        (function($) {
    
          // Only on mobile:
          if ($(window).width() <= 980) {
    
            // Move sidebar to top
            $('#secondary').prependTo('#primary');
    
          }
    
        })(jQuery);
      </script>
    <?php
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘woocommerce sidebar on top on mobile’ is closed to new replies.