You can use get_attachment_image():
$att_markup = wp_get_attachment_image( $attachment->ID, 'thumbnail' );
$att_link = wp_get_attachment_link( $attachment->ID, 'thumbnail' );
Related Posts:
- Creating a photo gallery in WordPress [closed]
- How can I alter the [gallery] markup?
- Custom wordpress gallery option
- Make a really simple gallery structure
- Modifying the media-template.php file, the right way?
- Responsive Images
- Set default link type to “file” for image galleries
- Add option to “Gallery Settings” section
- WP_Editor – Remove TinyMCE Toolbars
- Add size in Gallery Settings in Media Library
- Media gallery – inserting full size images without link
- Disable Linked Gallery Images If Mobile Browser
- Possible to add same caption to all photos in a gallery?
- How to Add a Custom Colum on Thickbox Media Gallery Tab?
- WordPress 3.5 Gallery Menu Order not set?
- Getting the image title/alt attribute from the gallery shortcode
- How to get post attachments in gallery post format template
- Can I attach an image to a different post?
- How do I use two different images, one as a thumbnail and one as a linked image?
- How can I show these pictures in two columns in my page?
- How to determine if a post has attached images?
- How can I make wp default gallery responsive?
- How to get clean code for a gallery?
- Gallery set to “Media file”, showing as attachment page
- Attach custom gallery to a page
- Gallery Only Displaying One Thumbnail
- How To Put Multiple Image Galleries In A Single Post?
- Add new images to top of existing gallery not bottom
- Fancybox not working. why?
- Large Media Library
- How do I create a gallery page?
- Can I nest a element within tags from default wordpress?
- Strange issue with gallery when displays 3 columns
- Can I have the same image in multiple NextGen galleries? [closed]
- Hide Gallery from the_conent
- Custom links or pages from Media Gallery
- My “Description” in gallery doesn’t accept formatting/html
- How do I export WordPress galleries?
- How to show private flickr group on a WordPress site?
- How to use the WP export and get images that are contained in a posts gallery
- How to add a list of all galleries to my sidebar?
- Is it possible to import NextGen Galleries into WordPress Galleries and convert embeds in all posts? [closed]
- Gallery Shortcode – only show first x thumbnails
- Image Gallery links to medium image instead of FULL size image
- Gallery Shortcode Showing IDs
- Can’t get the columns of galleries when the user set the column number to 3 if there are 2 galleries?
- How to make universal gallery and improve admin side of managing galleries?
- Get gallery images from page ID
- WordPress Gallery Thumbnail images look blurry
- Where is image gallery information saved?
- Display number of latest images from wordpress gallery in your homepage
- Checking for ‘gallery’ shortcode using strpos always returns false
- WordPress Gallery not being output correctly/consistently
- Add #content to next_image_link()
- Implementing Lightbox Photo Gallery in
- Gallery image caption inside link
- How to retrieve media images urls in different sizes?
- Why do the images only display in original size, not my custom size?
- Possibilities for customising the standard wordpress gallery?
- WP Gallery showing captions twice
- zip download plugin works well in localhost but not on live site
- Gallery order specified by shortcodes is ignored in gallery function
- How to add a div around the default gallery output
- Slideshow with thumbnails
- Ipad app: Need uploaded images to go into “Gallery” as well as “Media Library”
- Workflow for users to download files?
- Gallery – custom html for inserting images
- making wordpress gallery responsive
- Images hidden from wordpress gallery
- Multiple WordPress Standard Galleries on a page stop images being displayed from other page galleries
- Getting gallery instead of single attachment
- Get caption from unattached images in gallery?
- Add title tag to image in wordpress gallery
- WordPress Gallery is not displaying
- Page WYSWIG only allowing slides
- Pulling in Column Count in Custom Gallery
- Post gallery loop with thumb and full size
- How to add more fields to wordpress galleries?
- How to refresh the Gallery images?
- next_image_link Displaying All Images Attac
- the_content() won’t load galleries on homepage
- How can I make gallery slideshow width fit to picture width?
- Change the values of numberposts gallery
- Why do all Gallery functions return null for me?
- How to display images that was uploaded in the media gallery and not by the current post?
- How to show the image caption on custom post type …?
- JavaScript Errors when Loading NextGEN Gallery [closed]
- Numberposts 1 not cooperating in 3.5
- Generated WYSIWYG gallery with individual gallery_page templates
- Multiple Galleries in WordPress 3.3.1
- Get post image gallery link
- How can I add hover text to images of a basic gallery on wordpress elementor?
- How to create a custom image gallery in the footer?
- Use bootstrap for wordpress gallery? [closed]
- Click thumbnail, change main image – NextGen or somethign else?
- Looking to implement a scrolling gallery in my theme
- Hover/Zoom on Lightbox gallery
- Need help making Gallery slideshow with lightbox work correctly
- How to upload multiple images per single post and display them in a gallery?
- how to add this type of gallary photo number counter?