I am creating a One page Design in WordPress. I can include the page content and title in the index with the following code:
<div id="column3"><!-- Start Column3 --> <?php $page_id = 5; $page_data = get_page( $page_id ); ?> <h2><?php echo $page_data->post_title; ?></h2> <?php echo $page_data->get_the_post_thumbnail; ?> <p><?php echo $page_data->post_content; ?></p> </div><!-- End Column3 -->
Only, the featured image doesn’t get loaded in. Is there another method to make it work?
I’ve added the following code into my Functions.php:
<?php add_theme_support('post-thumbnails', array('page')); ?>
- The topic ‘page_data->get_the_post_thumbnail’ is closed to new replies.