 <p>Use <a href="https://codex.wordpress.org/Template_Tags" rel="nofollow">get_the_post_thumbnail</a> function.<br> In this case it is better use The Loop fundamentals of WordPress.<br> References:<br> <a href="https://codex.wordpress.org/The_Loop" rel="nofollow">https://codex.wordpress.org/The_Loop</a><br> <a href="https://codex.wordpress.org/The_Loop_in_Action" rel="nofollow">https://codex.wordpress.org/The_Loop_in_Action</a></p>