Just use wp_get_attachment_image_src
2 times, to retrieve the 2 sizes:
function display_images_in_list($size="thumbnail", $fullsize="full") {
//.. previous function code is good ...
foreach($images as $image) {
$th = wp_get_attachment_image_src($image->ID, $size);
$full = wp_get_attachment_image_src($image->ID, $fullsize );
printf(
'<a href="https://wordpress.stackexchange.com/questions/114265/%s"><img src="https://wordpress.stackexchange.com/questions/114265/%s" width="%d" height="%d" alt="https://wordpress.stackexchange.com/questions/114265/%s" /></a>',
$full[0], $th[0], $th[1], $th[2], esc_attr( $image->post_title )
);
}
}
}
the use the function like this:
<?php display_images_in_list('ca_thumb-large', 'recipe-full'); ?>
Related Posts:
- What’s the proper way to find and remove duplicate images from posts and the media library?
- get_post_gallery with Gutenberg
- Insert an image into a post by API
- Saving the pre-sanitized filename of an attachment as the Title or Caption
- Creating a rotating header /image slider using theme customization
- Add aditional class to get_avatar when showing image
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Double thumbnails?
- Alter media caption/description conflict in WordPress?
- No srcset for hard-cropped thumbnails
- Loop through child images of a parent for a Nivo Slider
- Rename attachments during upload
- alt, title tags not showing
- Limit author image size
- Remove the http protocol from images
- How can I store an image in the database with Transients API?
- Query for recent images across multiple posts
- How to prevent resized featured images?
- Display one random image, but only if landscape
- Is there a way to get attachment data?
- How to change image url?
- Warning: getimagesize() [function.getimagesize]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 [closed]
- How to add data attribute to all images in posts [closed]
- How to order images in a post in WordPress 3.3?
- Special purpose photos with each post
- WordPress – different icon image depends of comment number
- Image thumbnails not available post migration, but still accessible via direct URL – DB issue
- Override img class in gallery
- Change image url size in post editor (when cliking on image)
- Multiple images with Media Uploader on front-end
- Exclude images from “inserted into post” when trying to get attachments
- Set jpeg_quality for certain post-types
- image uploaded cant be shown
- Turn off image captions in gallery view?
- WordPress automatically downscaled images larger that original
- Unyson Framework doesn’t show gallery images
- Sharing images to social media – issue with aspect ratio
- How to add custom classes to figure element only if image has caption?
- I got an issue after i migrated a site
- add_shortcode to capture URL screenshot not loading correctly
- Show image crop window on image upload
- I want to use the GD image editor for just one function then switch back to ImageMagick
- 409 error (Conflict) when trying to insert an image into a post
- Exclude image titles from search results
- Gallery with thumbnail carousel
- Uploaded images not displaying in network site
- Does WP create multiple images?
- Thumbnails generated by “add_image_size” are not removed when removing media
- WordPress 3.0 embedded images
- TImthumb not working for absolute path
- Correctly implementing the Facebook Like button
- Omit image captions from get_the_content()
- Change image name during uploading sequentially
- Store in media library image uploaded from url
- How to limit the number of images displayed in the media window?
- Is it possible to preserve original images in order to change image size later?
- Get images attached to a specific page
- Need custom picture field for pages
- Only make custom image size if uploaded via Thickbox and attached to certain page
- add_image_size function not working
- image resizing on post content without css and html tags
- Stop WordPress compressing images? – Quality is terrible
- How to add onclick event to widget image
- Use default image as var
- Specify automatically the height and weight of the images
- Using mysql to replace img src?
- wordpress add image size crop function not working in version 3.8
- How to crop images in a certain size only for a certain page?
- Cache issues with images not showing up
- Specific Days, Specific image on Front Page
- How to change image’s author via a function when using GravityForms uploader? [closed]
- Doing a bulk replace of images through back-end
- Serving Images from subdomain in wordpress
- Can I achieve this with WordPress?
- Hover a css icon width other color inside wp_get_attachment_image
- I would like to set a FULL SCREEN background image to all my pages (same way it is on my home page)
- How to change a theme’s footer image
- Can’t upload Images to WordPress – Error 500 Response
- Enlarge Featured WordPress Images
- WordPress 4.4.2 upload give error, can’t write is upper directory allowed to be written
- How to attach 1000’s of unattached images
- Images are not getting uploaded
- Unable to delete images in Media Library
- How to show only one image in homepage
- Broken imges after moving wordpress website from localhost to server [closed]
- click on Gallery picture but pictures doesn’t appear
- How to Generate Custom Image Size in Uploads Folder?
- set specific dimension or minimum upload size [duplicate]
- Select image and display from textfield?
- Assigning image to Post-Type won’t work anymore: exceeded time?
- Content around featured image
- Getting featured image of blog page rather than post image
- Set padding for all content except images and few more elements
- Theme files and imagesnot loading on a mobile device
- Guaranteed Image Sizes
- How to change the alignment of the background image for small screen (tablet/smartphone etc.)
- get_theme_file_uri function not showing background image inside data-setbg in html
- How to show file type of featured image?
- Uncaught Error: Call to undefined function file_is_valid_image()
- Remove one srcset entry from wp_get_attachment_image