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

Gabriel Ward
Gabriel Ward
20,222 Points

Displaying a cropped version of a post feature image.

I have my home.php template set up so that it displays post feature images on the blog post listing page.. They are uncropped. When the thumbnail and the actual post's page is viewed, I want a cropped version of the same feature image to be displayed. How might I do this? At the moment, here is my thumbnail code in single.php

<?php if( get_the_post_thumbnail() ) : ?>

                        <div class="post-img">
                                <?php the_post_thumbnail('medium'); ?>
                            </div>
                                <?php endif; ?> 

Do I need to set a new image size or something like that in functions.php?

Any help is much appreciated.