Single Featured Image Repeating

This is wrong <?php if ( have_posts() ) { while ( have_posts() ) { if ( has_post_thumbnail() ) { echo “<div id=’post_thumbnail’>”; the_post_thumbnail(); echo ‘<h4>’ . get_post(get_post_thumbnail_id())->post_excerpt . ‘</h4>’; echo “</div>”; } the_post(); You are calling your thumbnail before the_post(). Just move the_post() to before if ( has_post_thumbnail() ) {

How can I retrieve a Featured Image thumbnail using only the Post_title?

You can try the following: /** * Get the featured image by post title (Simple version) * * @see http://wordpress.stackexchange.com/a/158344/26350 * @param string $title Post title * @param mixed $size Featured image size */ function get_featured_image_by_post_title_wpse_simple( $title=””, $size=”thumbnail” ) { $obj = get_page_by_title( $title, OBJECT, ‘post’ ); return ( is_object ( $obj ) ) ? … Read more

How do I get thumbnails?

If your theme has support for Post Thumbnails the “Featured Image” metabox will be visible on the on the Edit Post and Edit Page screens. If it isn’t, make sure “Featured Image” is enabled in the screen options on the top right. After clicking the “Set featured image” link insert image. Once you have selected … Read more