lizzmo
Member
Posted 8 months ago #
Here is the code I'm using:
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail', $size='thumbnail' ); ?>
I put the thumbnail size in the media section of the control panel and added <?php add_theme_support( 'post-thumbnails' ); ?> to function.php.
But the image is coming up full size instead of cropped to thumbnail proportions. Please let me know how to fix it. Cheers!
If you're inside the Loop, you can just use:
<?php if (has_post_thumbnail() ) the_post_thumbnail(); ?>
lizzmo
Member
Posted 8 months ago #
Alright its resizing the featured image now, but even though I have hard crop set to true its still doing a box resize. Any ideas?
code in functions.php
<?php
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 105, true );
?>
Do you have the same issue with fresh updated images?
Indeed, if you changed the cropping method, you have to refresh your previously cropped images to get the new crop you want.
lizzmo
Member
Posted 8 months ago #
absolutely right, thanks! just had to delete and upload the image again.