• Resolved mariosetien

    (@mariosetien)


    How I know the name of a CSS

    The name is whatsappme.min.css

    // exclude main and child stylesheets from delivery optimization
    function exclude_from_delivery_optimization($handle){
    return in_array($handle, array(‘main-stylesheet’, ‘child-stylesheet’));
    }
    add_filter(‘speed-up-optimize-css-delivery’, ‘exclude_from_delivery_optimization’);

    Then??

    // My changes
    function exclude_from_delivery_optimization($handle){
    return in_array($handle, array(‘whatsappme.min.css’, ‘whatsappme.min.css’));
    }
    add_filter(‘speed-up-optimize-css-delivery’, ‘exclude_from_delivery_optimization’);

    is It correct?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author nigro.simone

    (@nigrosimone)

    No, the name is the “handle” string. Follow this tutorial for retrive all the “handle” string of your css: https://crunchify.com/how-to-print-all-loaded-java-scripts-and-css-stylesheets-handle-for-your-wordpress-blog/

    • This reply was modified 5 years, 2 months ago by nigro.simone.
    • This reply was modified 5 years, 2 months ago by nigro.simone.
    • This reply was modified 5 years, 2 months ago by nigro.simone.
    Thread Starter mariosetien

    (@mariosetien)

    Perfect, I obtain then de handle string with this method, thank you.

    The name is whatsappme

    is then correct the following code?

    function exclude_from_delivery_optimization($handle){
    return in_array($handle, array(‘whatsappme’, ‘whatsappme’));
    }
    add_filter(‘speed-up-optimize-css-delivery’, ‘exclude_from_delivery_optimization’);

    or child-stylesheet goes empty?

    Thank you again

    Plugin Author nigro.simone

    (@nigrosimone)

    For just one css to esclude you can use:

    exclude_from_delivery_optimization($handle){
      return $handle === 'whatsappme’;
    }
    add_filter(‘speed-up-optimize-css-delivery’, ‘exclude_from_delivery_optimization’);

    Use array for list of css to exclude

    Side note, I would really appreciate it if you could take a minute and post a review here https://wordpress.org/support/plugin/speed-up-optimize-css-delivery/reviews/

    Thank you for your help!

    • This reply was modified 5 years, 2 months ago by nigro.simone.
    Thread Starter mariosetien

    (@mariosetien)

    Thank you, there is a sintax error in the last code, it is not run. Can you solve it?

    Thread Starter mariosetien

    (@mariosetien)

    OK,

    Your code needs “function” at the beginning but after of this i have other error:

    “ParseError thrown

    syntax error, unexpected ”whatsappme’;’ (T_ENCAPSED_AND_WHITESPACE)”

    Plugin Author nigro.simone

    (@nigrosimone)

    function exclude_from_delivery_optimization($handle){
      return $handle === 'whatsappme';
    }
    add_filter('speed-up-optimize-css-delivery', 'exclude_from_delivery_optimization');
    • This reply was modified 5 years, 2 months ago by nigro.simone.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Ignore a CSS?’ is closed to new replies.