• I’m trying to insert images into my posts, but when I change the size to “Custom Size” it doesn’t generate a thumbnail, just stretches the old one.

    Is there a way to make it generate a thumbnail?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there

    What theme are you working with? Also, what version of WordPress are you on?

    Some themes can affect how the “Custom Size” works in image uploads

    Have you tried setting your preferred image sizes in the Media Settings section of the admin area?

    You could also try something like Regenerate Thumbnails to have it rebuild the thumbnails to your preferred size

    https://www.ads-software.com/plugins/regenerate-thumbnails/

    Thread Starter skedd

    (@skedd)

    Thanks for replying. I am using a theme I coded myself. I haven’t posted much yet, so I don’t know if this is a size I will be using a lot, but 500x500px was just the right size for the pictures in my current post.

    I imagine I will need other sizes, which is why I don’t want to change the default thumbnails (which it seems like what regenerate thumbnails is based on).

    Hi there

    It could be something to do with your theme code.

    Out of interest, could you try using the default WordPress theme, e.g. 2015, to see if custom sized images can upload and display properly?

    If so, you may want to take a look at your post thumbnail size settings:

    https://codex.www.ads-software.com/Function_Reference/set_post_thumbnail_size

    Thread Starter skedd

    (@skedd)

    I tried to add more images sizes, added this to functions.php in my theme folder:

    add_theme_support( 'post-thumbnails' );
    
    add_image_size( '100px', 100, 9999 );
    add_image_size( '200px', 200, 9999 );
    add_image_size( '300px', 300, 9999 );
    add_image_size( '400px', 400, 9999 );
    add_image_size( '500px', 500, 9999 );
    add_image_size( '600px', 600, 9999 );
    add_image_size( '700px', 700, 9999 );

    but that didn’t see to have any effect. Is there something I did wrong in this file, or something I need to do to rerun the functions.php?

    I don’t think it’s a problem with my theme or install, just a wordpress thing. If I set the image size to medium, it will look like this: https://i.imgur.com/GUKzTC6.png , and if I then resize it to custom 500px wide, it just stretches out that thumbnail, rather than making a 500px wide one https://i.imgur.com/gvjBkp6.png

    edit: These custom sized ones also don’t resize when the screen is shrunk on mobile so they stretch out the page. Not sure if the default sizes do that.

    Thread Starter skedd

    (@skedd)

    I think I’m all set, had to reupload a couple images to get them to see the new image size, but now they all are correct.

    Had to add heigh: auto !important into my css and they seem to work on mobile now too.

    Thanks for your help CJ.

    Awesome. You’re welcome

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Generate thumbnails for Custom sized images in posts’ is closed to new replies.