I'v created a custom thumbnail size (in my function.php) called 'thumb-bookmark' and wanted to add a permalink to all of them but I don't know how to target only this specific size with this code:
function thumb_bookmark_html( $html, $post_id, $post_image_id, $size ) {
$html = '<a class="MyClass" href="' . get_permalink( $post_id ) . '" alt="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>';
return $html;
}
add_filter( 'post_thumbnail_html', 'thumb_bookmark_html', 10, 3 );
I've tried to add something like
$size = get_the_post_thumbnail('thumb-bookmark');
but, as I'm a noob beginner with php, it doens't worked of course :p
I've been searching on Google for hours without successs so any help will be much apreciate :) Thanks