I know, we can add a featured image to a post WordPress. But I want to know, can we also add a featured image to a page. If so, please share how.
Thanks Guys!
I have static page call ‘homepage’ in a template called ‘HomePage Template’
This is the code for HomePage-Template.php
<?php
/*
* Template name: HomePage Template
* Description: Homepage Template use to create your home page as a default view.
*
*/
?>
<?php get_header(); ?>
<div class="grid-12">
<?php//get page content and display ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?//this will echo the page content ?>
<?php the_content(''); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?//php get_sidebar(); ?>
<?php get_footer(); ?>
Primary Question: Is there anything needed to activate or add a featured image option in the editor for pages?
WordPress defaults to only having featured images “turned on” for posts.
To activate featured images for pages, simply add this line (to
functions.php
or elsewhere):That’s it!
Still not working?
If you still don’t see the featured-image meta box in the editor for pages, be sure to check the
Featured Image
checkbox in theScreen Options
dropdown (top right tab in the editor when on a new/edit page/post screen).you can get page thumbnail same as like post