This is answered here: Get post thumbnail size
global $_wp_additional_image_sizes;
// Output width
echo $_wp_additional_image_sizes['main_image']['width'];
// Output height
echo $_wp_additional_image_sizes['main_image']['height'];
Related Posts:
- Filter to remove image dimension attributes?
- Stop wordpress from hardcoding img width and height attributes
- How to automatically add rounded corners to thumbnails?
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- Is there a hook which fires after all thumbnails are generated?
- Featured image shortcode
- How to find attachment by it’s name?
- Cropped featured image replaces original image in gallery
- Image Scaling using get_the_post_thumbnail issue in WordPress
- Remove title attribute from images
- Insert an image into a post by API
- How to create thumbnails with a fixed width, so all of them will have the same width?
- How to limit number of images being printer out in “Set Featured Image” pop up?
- Black and White thumbnails
- How can I add the “Use as featured image” to a custom metabox?
- Double thumbnails?
- No srcset for hard-cropped thumbnails
- How to output placeholder image if no featured image set?
- Featured Images on Front Page
- Download button for Featured Image in every post – automatically
- Removing Title Tag from Thumbnails
- Show prev and next post links for parent post of current image in attachment page?
- Add a featured image in my theme?
- Featured Image .svg height and width 1px only
- How to check if user is uploading/setting an image as a featured image?
- Images are randomly deleted from server
- attach unattached featured images to respective posts
- Thumbnails are bigger in size than the original image
- Remove image classes from post thumbnail output
- Lazyload post thumbnails
- Exclude featured image from gallery in wp-admin
- Special purpose photos with each post
- SVG Featured image not shown in twitter
- Featured images not displaying at full resolution
- WordPress crops images differently on retina screens?
- Big Image on Featured Post, Normal on Single Post
- offload media to external services [closed]
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- How to stop wordpress always displaying full-res images
- WP keeps looking up post thumbnail on https even though wp-config says http
- Images stopped loadding after adding SSl
- WordPress PNG compression issue
- How to replace images?
- Fixing image names for a site being restored
- Setup Featured image on all posts from thesis thesis_post_image custom field?
- Export xml use/import images from theme directory
- Bulk-add featured images in posts with no featured image
- Should I not compress my jpeg files before uploading to avoid double compression?
- Custom responsive ‘featured image’ sizes
- Is it possible to preserve original images in order to change image size later?
- the_post_thumbnail(‘medium’) setting some images width=1 height=1
- Generating a certain sized thumbnail on the fly?
- How do you import images from a URL in your post?
- How to set uploaded image as featured image wordpress
- What can i do add title to ‘large’ image?
- Retrieve Image Attachments Getting Post Thumbnail Image First
- Height and width attribute not setting by the_post_thumbnail
- add_image_size function not working
- How to force WordPress to upscale images?
- What sense makes medium_large_size_h => 0?
- How to set minimum required size for featured image?
- All Images not calling alt text
- How do I link a featured photo to it’s post?
- Can we use featured image as third party website image URL
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Show (print) featured image all dimensions (height, width)
- Use default image as var
- add_image_size not working
- Serve different images per screen size and cache possible?
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- Placing a featured image into header
- Convert featured images into “product images”
- Resize uploaded images [duplicate]
- How do I display the featured image from an image gallery using a reference in code? (example within)
- How to use the thumbnail size with catch_that_image
- Using different size thumbnails on different parts of my site… with functions.php?
- Thumbnail and image management
- attach several images to post + gallery
- my featured image of wordpress are not showing in the front end though image are uploaded in media library
- How to change Gallery image url in product page ? In function.php?
- How is called this thumbnail slider feature
- Custom image size not displaying with wp_get_attachment_image()
- How to delete original image file after upload and resize
- An error has occurred during the upload process in wordpress version 5.3.2
- Force WordPress to always generate a thumbnail for original image
- Show featured image in all posts
- Get post thumbnail in specific size
- How to set a post featured image from an already made custom field
- featured image in custom poste type (backend)
- Custom Background for each page and post
- Using custom field to change alt text for a featured image
- How to display image thumbnails on the search results page?
- Declare global variable that can be used on other function
- Get custom size of thumbnails
- Black and White Thumbnail in WordPress Gallery
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- I tried to move the featured image below the paragraphs but now it is displaying twice
- How to import external media items into wordpress media library (without using storage)
- How can I use an image from an external source without uploading it to the media library
- Is there a way to upscale a media library original image to the nearest whole pixel in WordPress?