get the post thumbnail sizing
-
Hi,
I’m creating previous and next buttons for each single blog post. So I have returned the thumbnails for each previous and next post.
The issue is I want to hard crop the thumbnails returned to a specific size due to some featured images being portrait vs landscape.
1st version of my code:
$prevPost = get_previous_post('true'); $prevthumbnail = get_the_post_thumbnail($prevPost->ID, array(300,300, true));The portrait thumbnail image assigned to one of the posts is being resized but only on one edge. It’s not turning into a 300×300 square with a hard crop.
Can this crop be made here? or does it have to happen when the thumbnail is added to the post (via adding a new image size)?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘get the post thumbnail sizing’ is closed to new replies.