I can’t speak for the size of the image, but I assume small images that have a dimension about 50px should have the size around 5 or 10kb. You can add your own custom size to your theme:
add_image_size( 'tiny-thumbnails', 50, 50, true );
Setting the fourth parameter to true
will force the WordPress to crop the thumbnails, so they will be exactly 50px in width and 50px in height.
Now, calling this function will get you your tiny thumbnails:
the_post_thumbnail_url( $post_id ,'tiny-thumbnails' );
Don’t forget to regenerate the thumbnails after adding this code to your theme’s functions.php
file.
You can also tweak with the JPG quality, to reduce the size of your thumbnails (which also reduces the quality!). The jpeg_quality
filter allows you to do this.
// Set your quality to any value you wish. Values below 70 are not recommended
add_filter('jpeg_quality', function($arg){ return 85; });
Related Posts:
- How to get image title/alt attribute?
- How to disable WordPress from creating thumbnails?
- How do you get the post thumbnail size?
- set_post_thumbnail_size vs add_image_size
- Minimum Dimensions Requirement for Featured Image?
- Generate Thumbnails only for Featured Images
- How to get all featured image sizes and their URLs?
- How to Dynamically Resize WordPress Image On-The-Fly (custom field/theme option)
- Display thumbnail only if requested size exists
- the_post_thumbnail responsive srcset not populating with custom image size
- How to add multiple image sizes of the same size with add_image_size
- New image size version only for the Featured Image file
- Can’t extract and set SVG dimensions
- Getting custom-sized featured image’s URL?
- Showing a placeholder/default img, if no featured image is set
- Featured image with the same height thumbs returns wrong thumb
- How to change the naming of the resized image files
- Change Output for Images in Content
- Can WordPress crop only the post thumbnails?
- Allow user to manually set crop area of default/custom image sizes on upload [closed]
- How to get the image sizes, in a function, as per the sizes mentioned in the media settings?
- Resizing Images to lower Disk Space Using Plugins
- Only create image size when used in featured image
- How can I get a different image size, if all I have is the link?
- How to get custom image sizes into media uploader dropdown?
- WordPress resizes image to the same size as uploaded
- add_image_size and add_filter(‘image_size_names_choose’, ‘my_custom_image_sizes’) not working with wordpress 3.5.2
- wordpress responsive image srcset not working
- Customising the size of images served in Visual Composer elements [closed]
- How do I get a random image from subset of images in media gallery?
- How to scale up post thumbnails/featured image?
- Why are extra 92 pixel square thumbnails created?
- wp-cli regenerate media is not working for custom sizes
- Upload 3 different featured image sizes to WordPress
- Remove dimensions from filename featured image
- Can a thumbnail of an animated gif be animated?
- WordPress Uploader Editor shows broken image
- add_image_size not working with the_post_thumbnail
- Why does the Hard Crop option Scale?
- How do I set the default “feature image” size?
- How to get full absolute url for post attachment?
- Thumbnail Cropping with add_image_size?
- thumbnails are getting clipped down, want to resize instead
- How check that there is post thumbnail feature image or not on wordpress?
- If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with ‘new copies’?
- How to get cropped thumbnail source for custom post type
- Exclude featured image from attachment loop
- 2 image size for post
- Featured Image Not Working when loaded from sub-domain
- How can I see where in my themes and plugins certain image sizes are used?
- Generate image for newly added size
- How to both crop (with tool) and resize thumbnails having only a max width constrain?
- “Medium” size image displayed instead of “thumbnail” in only one post, other posts are fine
- wp_get_attachment_image_src match smallest edge
- How to create resized versions of images added with wp_insert_attachment
- WordPress returns old thumbnail size after changing media settings
- Custom image size in the_content loop
- specify size of post preview image (not post thumbnail)
- Display featured image file size, extension, filename, type, orientation?
- media-library: how to insert thumbnails with a fixed width, regardless of landscape/portrait orientation
- the_post_thumbnail(‘my_image_size’) always outputs full image
- Server B handling add_image_size() differently than Server A
- Post thumbnail throwing size limit parameters in
- Get thumbnail image according to the screen
- Image with large file size not cropping
- What can I do if I set a gif as featured image? no thumbnail when i share on facebook
- images not showing despite using add_theme_support(‘post-thumbnails’);
- Resizing thumbnails retrospectively
- Trying to show link “Use as featured image” from Attachment window from t31os script
- post thumbnail: increase dimension if smaller than… Possible?
- Images uploaded on frontend display correctly but not in media editor.
- Make image full width
- How risize a thumbnail?
- Unrestricted height thumbnails
- custom thumbnail image size not working
- WordPress not creating “large” thumbnails
- Is wordpress compressing my images? if so, how to prevent it?
- Custom caption output for custom image size
- Display post thumbnail in foreach loop
- How to attach images that I “insert from url” into the post?
- the_post_thumbnail(‘medium’) still gives thumbnail-size img
- How to update custom image sizes?
- Attachment Image using wrong src?
- Create an instance of add_image_size
- custom image size not being fetched
- Thumbnails are hard cropped not matter what
- Featured image size always cropped bottom
- Using the_post_thumbnail do not rollback to original image if specified thumbnail does not exist
- Missing image size
- Post thumbnail not displaying correct size
- Making a ‘featured image’ become the image for a full banner (top of page) image in a blog post?
- wp_get_attachment_image_src() works on index, but not on Archives
- Featured Image, and Image in post
- Setting featured image based on related post
- Trouble Retrieving Thumbnail URL on Front-Page
- setting featured image is not working while running script in background, works when running that script from browser
- Custom image sizes are not used
- Editing featured image
- How to modify Media Library images DPI [ image quality down to make small in size ] [closed]
- wordpress featured image