Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Martin Stehle

    (@hinjiriyo)

    You can help yourself with three steps:

    1. Open the file “functions.php” of the theme and add the line add_image_size( 'sidebarthumb', 200, 100, true );. Save, close and upload the file.
    2. In the WP backend install the plugin “Regenerate Thumbnails” by Alex Mills (Viper007Bond) and run it once.
    3. On the Widgets page in the “Recent Posts Widget With Thumbnails” widget set the thumbnail size to “sidebarthumb”

    Now you can run the PageSpeed test again and see the difference.

    Thread Starter dianne92

    (@dianne92)

    I just did that

    Added add_image_size( 'sidebarthumb', 340, 170, true ); to functions.php – regenerated and still the same result. The Google PageSpeed Tools thinks the images could be optimized even more/better.

    Plugin Author Martin Stehle

    (@hinjiriyo)

    … and set the thumbnail size in the widget to “sidebarthumb”?

    If there should not be better results again please bear in mind that “Recent Posts Widget With Thumbnails” has no image optimization features.

    I know one further trick: decrease the JPEG quality for better compression rates. WordPress’ default value for it is 90%. With a plugin like “SimpleJPEGQuality” or a code in the “functions.php” like

    function zzz_custom_jpeg_quality() {
        return 75; // change the number until compression rate and image quality are both ok
    }
    add_filter( 'jpeg_quality', 'zzz_custom_jpeg_quality');

    and running “Regenerate Thumbnails” again you can play around it until PageSpeed’s result is sufficient.

    Thread Starter dianne92

    (@dianne92)

    … and set the thumbnail size in the widget to “sidebarthumb”?

    Yes
    Now tweaking the jpeg_quality values and will tell you how it goes.

    Thanks for the trick.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Properly formatting and compressing images can save many bytes of data.’ is closed to new replies.