I need the ability to add an image to a page, like a featured image. How can I do that, and how do I get the featured image to display in page.php? It can be a plugin if what I am asking can't be done within Wordpress itself out of the box.


Eek! A 33% acceptance rate isn't really going to do you any favours but lucky for you Wordpress' in-built post-thumbnail featured image functionality works for posts, custom post types and pages too.

Add the following line into your theme functions.php file:

add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );

Then in your page.php file and I stress that this must be used within the page loop (not outside of it) the following function will show your featured image on a page if it has one assigned to it.


Adding a featured image to a page is the same process as adding one to a post. On the page editing screen you will see a metabox with a link that says, 'Set a featured image' click that and you're good to go. No plugins required.

| improve this answer | |
  • All you need to add is add_theme_support( 'post-thumbnails' ); and this will also work for pages – stemie Sep 29 '14 at 6:29
  • 1
    Remember to toggle "featured image" in screen options afterwards. – FooBar Apr 11 '15 at 7:03
  • How should the exact code look like within the page.php file? – remoz Jan 1 '18 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.