A simple the_post_thumbnail(); issue
-
Hi,
I coded both my loop.php & functions.php to print a 225×150 featured image but it’s printing a default 150×150 image instead, as shown below:
in functions.php:
<?php if (function_exists('add_theme_support')) { add_theme_support('post-thumbnails'); set_post_thumbnail_size(225, 150, true); } ?>
in loop.php:
<?php if (has_post_thumbnail()) { $size = array(225, 150); the_post_thumbnail($size); } ?>
Here’s the <img> the loop is currently printing:
<img width="150" height="150" src="XXX/avatar_1a2-150x150.jpg" class="attachment-225x150 wp-post-image" alt="Resetting everywhere." title="Resetting everywhere.">
As you can see, those width and height HTML attributes shouldn’t have those values. Also, the filename should end as “225×150.jpg” instead of “150×150.jpg”. Right? Any suggestions? It’s my very first WordPress redesign from scratch. Oh, the excitement! Thank you ??
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘A simple the_post_thumbnail(); issue’ is closed to new replies.