Add this function to your functions.php file:
function show($size = NULL) {
global $post;
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
if(isset($size)){
$image_data_array = wp_get_attachment_image_src($post_thumbnail_id,$size);
}else{
$image_data_array = wp_get_attachment_image_src($post_thumbnail_id);//Default value: 'thumbnail'
}
echo $image_data_array[1]."x".$image_data_array[2];//here you can add more chars of strings if you want
}
and use it like this:
<a class="classname" href="<?php the_post_thumbnail_url( 'full' ); ?>">Full Image <?php show('full'); ?></a>
this is outputting WidthxHeight
, you can use any default image size thumbnail, medium, medium_large, large, full
or any custom size you have added using add_image_size()
wp_get_attachment_image_src
allows you to retrieve this information. developer.wordpress.org/reference/functions/…