Show featured image (and only featured image)
-
Hi all
I am using WP 3.3 with the Twenty Eleven theme, straight up out of the box. I would like to simply show each post’s featured image on the blog’s home page, NOT the image that is inserted into the post.
I am using Twenty Eleven out of the box, where index.php is the home page (showing latest posts). I just would like to insert the featured image to the left of the excerpt, and exclude any other images from showing up there. Basically a very typical blog layout, nothing unusual or fancy.
After mucking around a bit, it looks like the default is the exact opposite – show images that are inserted into posts, but don’t show featured images at all.
The out-of-the-box code for Twenty Eleven’s index.php is:
[code moderated per forum rules – please use the pastebin]
I’m assuming (having almost no php experience!) is that the part I need to modify/add to is
<?php get_template_part( 'content', get_post_format() ); ?>
I just don’t know what to do with this. What do I need to add here to show the featured image along with the title, meta bar and excerpt, and not show images inserted into posts? Will I need to break out each element (title, meta bar, excerpt, thumbnail and footer meta), since right now it just seems to be pulling everything?
I assume once that’s all done I’ll need to do some styling to align everything, which I should be able to handle .
Here’s the site right now (it’s just plain old Twenty Eleven): https://ec2-50-19-26-13.compute-1.amazonaws.com/blogs/mgck/
And yes, theme support for featured images is enabled ??
Thanks everyone!
- The topic ‘Show featured image (and only featured image)’ is closed to new replies.