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
- WP “optimizing” PNGs into thumbnails 5X larger than originals – FIX
- optimized PNGs 5X larger than originals
- How is called this thumbnail slider feature
- Images not showing after wordpres update 5.6
- How to get title of images in post content
- How to generate alt attributes with php / filters?
- Custom image size not displaying with wp_get_attachment_image()
- Display Multiple Photos as Featured Image when mouse moves on to it post
- how to regenerate webp et-pb-portfolio-image
- Auto Generate Thumbnail
- 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
- unsharp thumbnails after uploading image
- How to delete original image file after upload and resize
- attachment_fields_to_save first parameter is null
- 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
- ADD class to all my images (thumbail)
- When upload a PNG a noise appears in the thumbnails
- Image alt attribute
- Thumbnails are hard cropped not matter what
- Featured image size always cropped bottom
- How to trigger “wp_handle_upload_prefilter” filter when uploading an image programatically?
- Images missing from Blog post page
- Blank image thumbnails in media library
- How to disable post-thumbnail from generation?
- How to set a post featured image from an already made custom field
- js alert in add_filter function for image_send_to_editor
- featured image in custom poste type (backend)
- Why does wp_get_attachment_image_src return the wrong size, when the correct size exists?
- Custom Background for each page and post
- New portfolio items appearing smaller on the grid
- WordPress can’t detect any thumbnails size?
- 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?
- Using custom field to change alt text for a featured image
- WooCommerce Variation Swatches and Photos – get attribute thumbnail
- How to filter wp_get_recent_posts() to only posts that have thumbnails?
- set_post_thumbnail_size only working for width
- Dinamically modifying attributes of images on posts
- Delete post if featured image is smaller than Y pixels by Y pixels
- 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
- How to display image thumbnails on the search results page?
- Image thumbnail on single product issue | WooCommerce
- Declare global variable that can be used on other function
- Get custom size of thumbnails
- image_send_to_editor filter – Unwanted paragraphs and line breaks
- Url link to feature image in the portfolio [closed]
- How Do I Auto Generate Thumbnail from First Embedded Image?
- Why doesn’t WordPress make thumbnails for videos?
- How might one programmatically set the link for all images in all posts?
- Image filter works on attachement pages but not posts. I can’t get the image ID
- Trouble Retrieving Thumbnail URL on Front-Page
- Create a custom attachment thumbnail for quick page load
- Surround uploaded image link with div
- get the post thumbnail returns the full size
- Why are my ‘medium’ images the wrong size
- How do I get resized thumbnails?
- Removing image dimensions from `the_content`
- Black and White Thumbnail in WordPress Gallery
- can’t output gray scaled image I’ve created using add_image_size
- Rename uploads filenames to POST-ID on upload
- Why is WordPress loading a different sized post thumbnail?
- Create post thumbnails from images stored outside of uploads directory
- Imagem resolution responsive
- Title image is missing ( but is not the WP 3.5 issue )