How to get Thumbnail Dimension?
-
Please look into the PHP code and advice how to get Dimension details of Thumbnail image?
<?php if( get_post_meta($post->ID, "Thumbnail", true) ): ?> <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;height="150" width="150;" src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a> <?php else: ?> <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a> <?php endif; ?>
The current code doesn’t display dimension details and I’m getting “Specify image dimension” error in gtmetrix page performance check.
https://gtmetrix.com/reports/www.geekyard.com/GGRD7130
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to get Thumbnail Dimension?’ is closed to new replies.