• Resolved jorgitobg

    (@jorgitobg)


    Hi,

    Thanks for this awesome plugin, its really great.

    But I have a problem… our site generates diferent HTML menus and other elements if is_mobile so CSS applies on diferent ways… and when using criticalcss then design is broken.

    There is some rule to apply diferent criticalcss on mobile or desktop?

    Regards

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    hey jorgitobg;
    criticalcss.com (which generates the CCSS) assumes the mobile & desktop sites have the same HTML and that the differences in how the HTML is rendered is in the CSS (so you have a fully responsive site).

    what we could do here is add a code snippet to disable critical CSS when is_mobile is true. would you like me to provide example code for that?

    frank

    Thread Starter jorgitobg

    (@jorgitobg)

    Hi Frank thanks for your fast reply.

    Would be great to have this code….

    Regards

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Here you go;

    add_filter( 'autoptimize_filter_css_defer', 'mobile_no_ccss' );
    function mobile_no_ccss($in) {
      if ( wp_is_mobile() ) {
    	return false;
      } else {
    	return true;
      }
    }

    Do take into account that this only works if your page caching differentiates between mobile & desktop traffic or if you don’t have page caching in the first place ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘is_mobile issue’ is closed to new replies.