Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1170440
    bigboxhead
    Participant

    Hi,

    How would I make widgets that I have in a sidebar go to the top when viewing a product category on a mobile?

    Currently they always are pushed to the bottom.

    The page for an example is http://www.strawberryandblue.com/product-category/womens-t-shirts/

    Thanks very much

    #1170676
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! By default, the content area will appear first and then the sidebar area when viewed on mobile or smaller screens. If you want to display the sidebar first, there are many ways that you can do that. One of the easiest would be by using a JS code. Please add the following JS code in the customizer, Appearance > Customize > Custom > Javascript

    (function($){
      $(window).on('load resize', function(){
        var W = $(window).width();
        if ( W < 980){
          $('.woocommerce .x-sidebar').insertBefore('.woocommerce .x-main');
        }
      });
    })(jQuery);

    We would loved to know if this has work for you. Thank you.

  • <script> jQuery(function($){ $("#no-reply-1170440 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>