Display images of related posts
I’m fetching the attachment ID by get_post_thumbnail_id function which is taking the post ID. After getting the attachment ID of that post, I am passing this attachment ID to wp_get_attachment_image_src function and getting the image details. So I am rewriting your foreach loop like this way foreach($related as $r) { $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($r->ID), ‘thumbnail’, … Read more