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

ADD THUMBNAILS TO POST

Learned a new trick :D

THUMBNAIL TUTORIAL FOR POSTS:

  -1-STEP- 

// To enable Post Thumbnails, the current theme must include add_theme_support( 'post-thumbnails' ); ( add to functions.php add following )

 -2-STEP- (optional)

// Gets the Featured Image (formerly called Post Thumbnail) as set in post's or page's edit screen and returns an HTML image element representing a Featured Image, if there is any, otherwise an empty string.

set_post_thumbnail_size( 330, 200); ( add to functions.php under the -STEP1- )

 -3-STEP-

Go to dashboard. Open some kind of post and on thr right side you can see Featured Image BoX. Add the image with the media library and you are done :)

5 Answers

Anthony Hind
Anthony Hind
5,715 Points

Am I missing something how do I then get the featured image to display on the front end of my site?

Anthony Hind
Anthony Hind
5,715 Points

Iv figured it out guys

To display the thumbnail

-4-STEP-

if ( has_post_thumbnail() ) { the_post_thumbnail(); }

.