Add Featured Image to Top of WordPress Post

A lot of theme developers don’t add in the ability to have your featured image automatically display at the top of your WordPress post. The last thing you want to do is to set your featured image and then have to link/insert it again at the top of each post. Follow the steps below to easily modify your theme to insert your featured image at the top of each post.

WordPress Featured Image

Step 1

In your WordPress dashboard, go to Appearance > Editor.


Step 2

Click into your single.php file. (Please back this file up first. We suggest backing it up via FTP, this way if something goes wrong, you can just drag and drop the original back in)


Step 3

You will want to locate and find the following PHP.

[php]<?php the_content(); ?>[/php]

Then place this line of code right above it.

[php]<?php the_post_thumbnail(‘large’);?><div style="clear:both; margin-bottom:10px;"></div>[/php]

As you can see we added a 10px margin between the image and where the text starts. Also, if you are using small or medium thumbnails, simply replace where ours has ‘large’, with either small or medium.


Example of Post after adding WordPress Featured Image


You may also like:

Display Pingbacks on WordPress Posts with Disqus C... Pingbacks and trackbacks are no longer supported in Disqus 2012. Mentions via twitter are, but not pingbacks or trackbacks. The pingbacks are still...
How to Set Featured Products in WooCommerce This is a short tutorial on how to set a featured product in WooCommerce and a shortcode you can use. Sometimes when it's too easy it is hard to fin...
Backslashes Aren’t Working in WordPress Post... Are backslashes not working in your WordPress posts? The most likely reason for this is due to a WordPress plugin. The best solution is to disable you...
Add a line break into WordPress Post or Page I don’t know why WordPress can’t seem to get line breaks to work correctly. Anyways, if you are searching for this you have probably tried adding a br...
Deleting an old Permalink in WordPress Ever had a page or post in WordPress that you wanted to name a certain name and whenever it saved, it appended it with "-2" or "-3"? Example, I was tr...
READ ALSO  Add a line break into WordPress Post or Page
  • Cameron

    This was EXACTLY what I was looking for, thanks so much for your help Brian! One minor note if some people can’t find it in the single.php. I found this in the content-single.php….. Just a theme difference, but could be useful to some folks. Great stuff, thank again!