Support » Plugin: WooCommerce » Change layout small screen friendly breakpoint from 768px to 760px

  • Resolved jnette3

    (@jnette3)


    Hello,
    Firstly, thank you so much for all your support on this forum!

    So.. Woocommerce changes the layout to “small screen friendly” when the width is 768px or under.
    This feature clashes with my theme, as my layout changes to “small screen friendly” at 760, not 768.
    (I prefer 760 over 768, because iPad’s portrait view is 768px wide, and I think iPad’s screen is still too large for a “small screen friendly” view, and therefore 768px is too soon to activate it.)

    I located the code responsible for this, it’s at:
    woocommerce/includes/class-wc-frontend-scripts.php
    line number 32
    Specifically: $breakpoint = ‘768px’

    When I change the number above to 760, it fixed the issue, but i’m in need of a more permanent solution.
    I was hoping someone could help me write a code for my theme’s functions.php, which will change 768 to 760, even after woocommerce gets updated, etc.
    I’d really really appreciate your help.. 🙂
    Thank you so much,

    Love,
    Jeanette

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • In case you’re still looking (I found your post when I was looking to do the same thing), there’s a filter for that:

    add_filter('woocommerce_style_smallscreen_breakpoint','woo_custom_breakpoint');
    
    function woo_custom_breakpoint($px) {
      $px = '760px';
      return $px;
    }

    The code above in your theme’s functions.php file will change the breakpoint printed out by woocommerce.

    @zimm0r
    Thank you so much!!! I really appreciate your help. I’ll try it out. 🙂

    Thanks Zimm0r

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change layout small screen friendly breakpoint from 768px to 760px’ is closed to new replies.