Get featured image outside the loop using foreach
First you will need to get a list of all available sizes on your site. This function get_intermediate_image_sizes() will do that. You can then pass the results of that to image_get_intermediate_size() along with the post id and <?php $sizes = get_intermediate_image_sizes(); ?> <?php foreach($major_data as $postID) { ;?> <?php $postData = get_post( $postID );?> <?php … Read more