Unable to display the post thumbnail in the loop

the_post_thumbnail displays the post thumbnail. It generates HTML tag and echoes it. It does not echo only the URL to that image. So this line: <img src=”https://wordpress.stackexchange.com/questions/324413/<?php the_post_thumbnail(); ?>” alt=”<?php the_post_thumbnail_caption() ?>”/> Generates something like this: <img src=”https://wordpress.stackexchange.com/questions/324413/<img src=”” … />” alt=”…”/> So it’s not a correct HTML. I’d changed it to: <div class=”col-12 col-sm-4″> … Read more

Get author image from corresponding article in thumbnail

<?php echo get_avatar( get_the_author_meta( ‘ID’) , 150); ?> Is exactly what I use. I think the issue is with “foreach( $recent_posts as $recent )”, I recommend using if ( $wp_query->have_posts() ) : I recommend checking out https://developer.wordpress.org/reference/classes/wp_query/ and remember to reset the loop with after your done wp_reset_postdata();