Since you already know your $post_image_id, you can use wp_get_attachment_src()
$small = wp_get_attachment_src($post_image_id, 'smallest-size');
$large = wp_get_attachment_src($post_image_id, 'full');
$smallURL = $small[0];
$largeURL = $large[0];
where ‘smallest-size’ is the name of the image-size you have predefined in add_image_size()
Related Posts:
- Disable wordpress image sizes generation
- Filter to remove image dimension attributes?
- Is there a hook which fires after all thumbnails are generated?
- Change WordPress image URLs via filter
- get_the_post_thumbnail_url with an unregistered size
- Cropped featured image replaces original image in gallery
- Remove title attribute from images
- No srcset for hard-cropped thumbnails
- Removing Title Tag from Thumbnails
- Lazyload post thumbnails
- How to stop thumbnail generation from some images and different size thumbnail generate
- Update old Post image metadata to ‘thumbnail’ wp_attached_file
- How to stop wordpress always displaying full-res images
- Fixing image names for a site being restored
- 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?
- add_image_size not working
- Product Images Low Quality After Updating From WP 3.5 to 4 [closed]
- adding image to post thumbnail from another server
- How to add thumbnails to posts and pages automatically in a uniformed fixed elegant way?
- How to change Gallery image url in product page ? In function.php?
- How to use default image as featured image by implement some code in function.php
- WordPress Multisite: Images moved to /sites/1?
- I cannot upload images to post or the media library in wordpress
- Why image Thumbnail url is not displaying with custom size?
- Making a thumbnail if there exist a link with. jpg or .png extension in WordPress
- WP is showing wrong image dimensions
- I tried to move the featured image below the paragraphs but now it is displaying twice
- Programmatically get images by URL and save in uploads folder
- the_post_thumbnail responsive srcset not populating with custom image size
- How to change image type for specific size?
- is it possible to replace the use of gd_lib with imagick or ImageMagick?
- Insert an image into a post by API
- hook into completed image upload filter
- Filter Media Library by author or post_parent
- set_post_thumbnail_size not cropping featured images, but reducing proportionally
- How to grab first image attached to post and display in RSS feed?
- Double thumbnails?
- How to display a shortcode caption somewhere other than the_content
- Can’t Display Featured Image in RSS Feed
- Displaying a featured image (only img url) as the img src?
- When displaying the featured image, is has_post_thumbnail() necessary?
- Get original image from thumbnail URL
- Save image as featured image
- Thumbnails produce unwanted gray pixels on white background [closed]
- Image Quality Thumbnail Compression in WordPress?
- What’s the proper way to use the get_image_tag filter?
- Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?
- WordPress reduces the full size image and uses it as the original
- Special purpose photos with each post
- How to removes all instances of thumbnails displayed in my theme?
- Set Post Image Using Shortcode
- Print specific image size in galley loop
- WordPress crops images differently on retina screens?
- Image thumbnails not available post migration, but still accessible via direct URL – DB issue
- Upload media files to Amazon S3
- How can I add a “data-pin-nopin” the featured image html?
- How to add custom classes to figure element only if image has caption?
- how to link post-thumbnail to original img in a lightbox?
- Add padding while generating thumbnail
- Can’t generate thumbnail images
- Gallery with thumbnail carousel
- How to fit image to Thumbnail canvas size?
- Generate images to be associated for tag and category?
- Bulk-add featured images in posts with no featured image
- How can I use wp_save_image_editor_file filter?
- Why doesn’t WordPress use the smaller sized image?
- Get an image from url, resize it, and save on a custom folder (not the media library)
- Else/If Statement to Display Photo Descriptions
- Remove Additional image sizes created by theme
- Dynamically determine the width and height of a image file to be cropped & uploaded AFTER form submission given fixed aspect ratio
- Prevent WP from wrapping html in caption shortcode after ‘image_send_editor’ filter is applied
- Placing a featured image into header
- How to only show div of caption if caption exists on featured image
- Apply manual image cropping not to thumbnail but medium_large size
- Display Multiple Photos as Featured Image when mouse moves on to it post
- How to echo images Urls from a wordpress post, that are relally in the post
- WordPress Responsive Image ( srcset ) not work properly
- How to Display Image Caption but Not Alt Text
- Image alt attribute
- How to set a post featured image from an already made custom field
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- New portfolio items appearing smaller on the grid
- stop wordpress from resizing feature gif images
- second featured post not displaying on page [closed]
- Does WordPress have a way of changing the ‘Natural’ size of uploaded images?
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- set_post_thumbnail_size only working for width
- Newly uploaded images are not updating in featured image
- How to attach post ID to image links in WordPress tinymce editor
- Troubles with code for upload a image
- Image thumbnail on single product issue | WooCommerce
- Create a custom attachment thumbnail for quick page load
- get the post thumbnail returns the full size
- Why are my ‘medium’ images the wrong size
- Removing image dimensions from `the_content`
- Create post thumbnails from images stored outside of uploads directory
- Using the on-board image editor for featured images: edits are not being used
- has_post_thumbnail() Returns False on Scheduled Posts
- Media Library shows default image instead of image preview