Post Thumbnails 2:1 and full width

Hi!

I want the featured images to be full width and with the aspect ratio 2:1, without resizing them before uploading. I’ve already tried this, by changing the thumbnail size in the functions.php, but it didn’t work (or I’ve done it wrong). I want it to look like it is already on https://rcpetershagen.de/news/ but I don’t want to resize every image before uploading, because sometimes I write posts with my phone and it’s really laborious to resize pictures with the phone.

It would be really nice, I’ve you could help me with that problem.

Regards,
Timon

Hello Timon,

To change the article’s featured image size, add this PHP code to your child theme’s functions.php file. Or you can use a functionality plugin like Code Snippets without child theme.

    function sydney_child_new_image_size() {
      add_image_size('sydney-large-thumb', 830, 415, true);
    }
    add_action( 'after_setup_theme', 'sydney_child_new_image_size', 999 );

Then regenerate the new defined size with the Regenerate Thumbnails plugin.

Regards,
Kharis

Thank you for the fast response!

Sadly, these lines of code don’t have an effect at all. It looks the same as before.

Here’s a link to a test-post with a 16:9 image (the PHP code is added to the functions.php and I’ve regenerated all thumbnails):

https://rcpetershagen.de/news/test/

The width is okay, like before, but the height didn’t change after I inserted the code.

I hope you have another solution for scaling/cropping that image to another format and size.

Regards,
Timon