Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Andres Altuve
Andres Altuve
16,274 Points

Set Thumbnail size

I am trying to add custom thumbnail sizes to my theme following the example in the wordpress codex.

But for some reason it wonΒ΄t create the images I need.. Here is my code :

Function.php

add_theme_support( 'post-thumbnails' );


    add_action( 'after_setup_theme', 'ezt_blog_image_size' );
    function ezt_blog_image_size() {
    add_image_size( 'latest_post_size', 738, 458);
    add_image_size( 'home-post_size', 346, 228);
    add_image_size( 'latest-from-category', 250, 205);
}

page-home.php

the_post_thumbnail('home_post_size');

Any ideas on how to make it work?

Thanks.