WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Disable Photon for gifs (3 posts)

  1. lelouchryu
    Member
    Posted 1 year ago #

    Hi i wanna know if theres any way to disable photon for gifs, it is great for jpg images, but gifs sometimes apperas break i also use upscaled gifs sometimes to create certain gallerys and the plugin make the gifs appear scaled breaking the simetry of the composition.

    Maybe theres some function i can put on my theme to make photon ignore the gifs or act only on jpg's (that would be even better).

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    You could build you own function and use the jetpack_photon_skip_image filter to skip some of your images. Here is a super basic example:

    // Skip a image with Photon
    function tweakjp_photon_exception( $skip, $src ) {
            if ( $src == 'YOUR_IMAGE_URL' ) {
                    return true;
            }
            return $skip;
    }
    add_filter( 'jetpack_photon_skip_image', 'tweakjp_photon_exception', 10, 3 );
  3. lelouchryu
    Member
    Posted 1 year ago #

    Worked, many tanks for the tip.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic