• Hello guys,

    I have a problem with my homepage because thumbnails are too big (my home have more than 9MB!).

    As you can see here, my page is a bit slow because of the images sizes. In single posts, I want to keep the size.

    What can I do to improve my website? How can I reduce the images sizes? I already use Smush.it but I’m looking for something that I can use to reduze the images sizes/resolution/whatever.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey dothedance,

    Are you utilizing utilizing theme support for post-thumbnails in your theme? You could create multiple thumbnail sizes and then call theme in the proper location.

    Check out the Codex for more info: https://codex.www.ads-software.com/Post_Thumbnails

    WPLift.com has a great tutorial on this also: https://wplift.com/different-size-post-thumbnails-in-your-wordpress-themes

    Thread Starter dothedance

    (@dothedance)

    Hi Allen,

    I read the article and that would work if every thumbnails on homepage have the same size, right?
    In my theme (www.youandsaturation.com) I have a big one featured at the top. It’s possible customize de functions.php code to an exception?

    Thanks!

    Hey dothedance,

    You can specify multiple custom thumbnail sizes as such:

    add_theme_support( 'post-thumbnails' );
    	add_image_size( 'custom-thumbnail-size-one', width, height, true);
    	add_image_size( 'custom-thumbnail-size-two',width, height, false);

    The true and false declaration represent image cropping. Set to true, the image will be cropped. Set to false, no cropping will occur. You can also specify an unlimited height by using 9999.

    You would then call them in your theme as such:

    <?php if(has_post_thumbnail() ) { ?>
        <?php the_post_thumbnail('custom-thumbnail-size-one'); ?>
    <?php } ?>

    Post back and mark resolved if this helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Save new thumbnails / Crop thumnails’ is closed to new replies.