How to add Featured Image to a Page
Hello,
The last days/weeks I saw some blogs and questions of people who wanted to change their page in a post and vice versa.
So once there was a question of someone: how can I put a featured image into a page?
This goes like this:
REF:
http://wordpress.stackexchange.com/questions/40613...
Add the following line into your theme at the bottom of the functions.php file (with the editor in the appearance menu):
/*
* Add also feature images on pages
*/
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) );
Then in your page.php file and you just add the line below within the page loop:
<?php the_post_thumbnail(); ?>
A loop starts with "<?php while" and ends with "endwhile; ?>", so choose an "empty" line somewhere between these 2 statements and you're good to go...
The function we just added will show your featured image on a page if it has one assigned.
If anybody needs more info or some help with implementing this: Don't hesitate!
Grtz,
Bert
Recent Comments
20
Thanks for this! I thought it was impossible to add featured images to a page and I finally understood how and where to add a code :)
See more comments
NOW you tell me. LOL, I fiddled with it all weekend long.
Blog is posted on the 3th, I knew you would need this in the weekend...
;-)
sneaky.