I'm iterating over a custom post type that uses an image from the media library for each item. The images are being rendered for each one correctly with the right size, but for some reason it is loading the full image instead of the medium, which is greatly affecting my page load time.
Here is what I have:
$args = array( 'post_type' => 'recent-project', 'posts_per_page' => -1 ); $projects = new WP_Query( $args ); while ( $projects->have_posts() ) : $projects->the_post(); echo '<a href="' . $get_permalink(); . '">'; echo '<div class="item">'; echo wp_get_attachment_image( get_post_thumbnail_id( $post->ID ), 'medium' ); echo '</div></a>'; endwhile;
Anyone know how I can get the medium size to load instead of the full?