Resizing featured images?
-
So, I’ve added some featured image dimensions to my theme, but for some reason those are not used as I thought.
from functions.php:
<?php add_theme_support( 'post-thumbnails' ); if ( function_exists( 'add_image_size' ) ) { add_image_size( 'archive-thumb', 150, 100, true ); add_image_size( 'single-thumb', 300, 200, true ); } ?>
from single.php:
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail('single-thumb'); }
If you take a look over here:
https://www.vezbe.org/wp/test-post-7/
this is how it looks:
‘<img width=”300″ height=”200″ src=”https://www.vezbe.org/wp/wp-content/uploads/2014/05/pixabay/3/dinner_1400717547.jpg” class=”attachment-single-thumb wp-post-image” alt=”Breakfast, Dinner, Egg”>’
My question is: why is it using a full image, when there is a smaller size available:
https://www.vezbe.org/wp/wp-content/uploads/2014/05/pixabay/3/dinner_1400717547-300×199.jpg
Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Resizing featured images?’ is closed to new replies.