Problems with thumbnail sizes
-
I’m using the code below to display a list of posts on my homepage with thumbnail, title, and summary text.
The problem I’m having is that rather than using the thumbnail image which is a max size of 377px it’s using the full 1280px image and scaling in the browser.
<?php global $post; $tmp_post = $post; $args = array( 'numberposts' => 3, //'offset'=> 1, 'category' => 67 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <li> <?php echo get_the_post_thumbnail(); ?> <div class="post-details-wrapper"> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php the_excerpt(); ?> </div> </li> <?php endforeach; ?> <?php $post = $tmp_post; ?>
Now when I add ‘thumbnail’ ‘medium’ or any other attribute to get_the_post_thumbnail(); I don’t get any image at all.
Presumably I’m doing something wrong.
- The topic ‘Problems with thumbnail sizes’ is closed to new replies.