I have tried and researched but can’t find a solution to this. Basically I’m trying to display a particular post (post_id 1) on the homepage with its featured image.
The title and excerpt work fine, but the featured image does not.
<?php
$post_id = 1;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo "<h2>" . $title . "</h2>";
echo "<p>" . $queried_post->post_excerpt . "</p>";
the_post_thumbnail();
?>
Any suggestions would be helpful.
Try replacing:
with: