I am trying to make a child theme out of twentyeleven, and so far so good as far as the css goes, but now I want to display a featured image and I don’t know how.
I added this to my functions.php;
// add featured images
add_theme_support('post-thumbnails');
set_post_thumbnail_size(500, 200);
Which means featured images are enabled but it still won’t show up. I have used featured images in other, premade, layouts so I know I’m not doing anything wrong as far as setting the image goes. I think I have to add a bit of code in my single.php file or maybe my post.php file? I found this piece of code;
if (has_post_thumbnail()) {
the_post_thumbnail();
}
and put in my (empty) single.php file of my child theme but it didn’t work. What piece of code do I need and where do I need to put it to show these featured images?
or if you want to link to another size:
More in codex WP
Hope this helps
/Paul