Multiple Post Thumbnails force size
-
I am working on a site that uses multiple post thumbnails. The thumbnail size for single posts is 306×306. Some of the thumbnails are too small and I want to force the size. Here is the code that pulls in the thumbnails:
<div class="content-image"> <?php if ( class_exists('MultiPostThumbnails')){ ?> <div class="img"> <?php for( $i=1; $i<=5 ; $i++ ) { $image_id = 'featured-image-'.$i; $image_url = MultiPostThumbnails::get_post_thumbnail_url(get_post_type(),$image_id ); echo $thumb_id = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(),$image_id,$post->ID); if( $image_url != '' ) { ?> <a class="lightbox" href="<?php echo $image_url;?>" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 5; opacity: 0; width: 306px; height: 306px;"> <span><img width="306" height="306" alt="" src="<?php echo $image_url;?>"></span> <div class="sprite"></div> </a> <?php } else { break; } } ?> </div>
There are two places where image size is mentioned but I can’t figure out how to force the scaling.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Multiple Post Thumbnails force size’ is closed to new replies.