Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

ajberasategui on "Get Cropped Thumbnail"

$
0
0

Hi!

I'm writing a plugin for Wordpress. I need to retrieve cropped version of post thumbnail but I can't.

Here's what I'm doing:

I open the image in the builtin image editor, I crop it obtaining a 203 x 300px version. I crop it and save it (only thumbnail).

Then in my plugin I'm trying to obtain it with:
get_the_post_thumbnail( $post->ID, 'thumbnail' );
which gives me a 80 x 120px version (instead of 203 x 300)!

I've also tried the following way:

<?php
$image = wp_get_attachment_image_src( $attachId, 'thumbnail' );
?>
<img src="<?php echo $image[0]; ?>" alt="<?php echo $imgAlt; ?>" />

and I'm obtaining a 91x120px version!

Any help will be very much appreciated!

Regards
Agus


Viewing all articles
Browse latest Browse all 8245

Trending Articles