WordPress.org

Support

Support » Themes and Templates » Displaying Featured Image When Including Page

Displaying Featured Image When Including Page

  • Hi,

    I’m using the below code to include a pages content into a template.

    <?php
    $post_id = 12;
    $queried_post = get_post($post_id);
    ?>
    <h2><?php echo $queried_post->post_title; ?></h2>
    <?php echo $queried_post->post_content; ?>

    I’d also like to use: <?php the_post_thumbnail('');?>

    How can I make that appear so that within that section it shows the featured image of that post, and not the page it’s being display on?

    Thanks!
    Matt

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying Featured Image When Including Page’ is closed to new replies.
Skip to toolbar