Modifying image size inside the wordpress content

Asked

Viewed 35 times

0

For friends who understand wordpress, could you give me a hand? I need to modify the size of the images inside my content, image inside the posts.

I took an image resizing function here and works very well, my difficulty is to use this function within my functions to resize the size of Thumbs within the post.

I tried to work out a function but it’s not working, could someone tell me how to work that function?

function resizeThumb($html, $post_id, $post_thumbnail_id, $size, $attr){
$image = get_post_thumbnail_id();
$thumb = vt_resize( $image, '', 850, 600, true );
$html = '<img src="' . $thumb[url] . '" alt="' . $alt . '" class="img-responsive" />';
return $html;
}
add_filter( 'post_thumbnail_html', 'resizeThumb', 10, 5 );

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.