You can use wp_get_attachment_link(), function if you pass the size argument as medium you will get the medium size image link.
https://codex.wordpress.org/Function_Reference/wp_get_attachment_link
Related Posts:
- How can you set maximum width for original images?
- WordPress Image Editor not working – conflict?
- Image dimensions same as image size
- Best image hosting service
- Filter what image sizes get generated
- Media > Image Sizes aren’t being applied to uploads
- add_image_size landscape or portrait
- Force WordPress, themes & plugins into using defined sizes
- WordPress Media Image Manager — Creating Lots and Lots of Odd Sized Images
- Large image size stuck on old value, even for new images
- Can I force all uploaded images to be reduced in quality?
- Rotating image does not work for custom image sizes
- Link to resized media file
- Editing image dimension – to edit the main image file
- Force image crop size in media editor
- Set Maximum Width for an uploaded image
- How do I get WordPress to create resizes of a supplied default image in a theme?
- TwentySeventeen $content_width not updated in admin
- How to resize image in wordpress from backend? Seems like bug in wordpress
- Only current gallery images with get_attached_media
- Custom image sizes
- Custom post type with a forced fixed aspect ratio image crop
- How do I force WordPress to show most recent version of images in the media library?
- Using Images in WordPress – Best Practices
- display image size in media library screen
- Removing default image size list in Media Box
- Settings in ‘Media > Settings’ is ignored when inserting images
- wp media regenerate unknown –image_size parameter
- Is there a plugin to make attaching images easier?
- Best plugin to manage media library? [closed]
- How to display all images “Uploaded By” an author
- Shortlink directly to a media file?
- Is it possible to generate JPEG progressive thumbnails?
- Way to display media library in frontend
- Add visual editor to Media Edit Screen
- Rest API rename media
- Disable drag and upload in Media Library
- Custom media picker in meta box: how to select available image sizes?
- Moving existing media items to new upload path structure not updating full URL path
- How to bulk Edit Dates in Media Library?
- Rename media files generated during upload
- WordPress Built In Dialog Box For My Plugin
- Link to full size image or attachment page in photo theme
- How Do I Delete All The Images from WordPress
- How to get media objects
- image in my post disappeared after I upload website to remote server
- Pull images from the gallery
- Create Media via REST API from Android Application
- wp_generate_attachment_metadata is creating an empty array
- How to change image atributes right before an image to be saved?
- Is it possible to change ‘Link to’ in all images in all articles?
- Custom icons in media library
- Overwrite media matching post title using WP CLI’s media import command
- How to filter the image embed code based on link type
- Creating subfolders in the media library
- WordPress media upload automatic refresh
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Why it doesn’t show media urls on rest Api? (WordPress)
- Media Library empty after server move (exact copy of files and db’s)
- Media attachment pages giving 404’s
- Upload box media size not working
- Extending wp.media.model, query media from different blog on network and refresh view
- WordPress automatically adds links to uploaded images
- Limit dimensions of “Full” size images
- Media changes not updating posts
- Use rich text editor in ‘Edit Media’, for attachment media description
- Automatically Insert alt attribute above image has h2
- How to disable Media Library?
- Auto delete pictures in media library by age
- WordPress Attachments with old images
- Adding .mov files (not from YouTube) [duplicate]
- Set Featured Image not opening – Stuck at loading
- How to remove “Image Information” and “post date/author” from a media page?
- Control resizing of uploaded images
- Convert all uploaded PNG files to PNG-8 format
- formatting horizontal and vertical images in Settings?
- How to get a list of all attachements urls for every post of a wordpress installation?
- Access generated thumbnails
- Media permalink to go directly to uploaded PDF, instead of a media page with a link
- cant upload media/pictures to my wordpress site, cant upload anything to my database
- unable to write to the database while uploading images
- WXR file – Media import failed – how to force import?
- Get all uploaded images using REST api
- unsharp thumbnails after uploading image
- Post images are not displayed in media library
- Media and all images disappeared from my wordpress site
- Replace Swedish characters in filenames
- Use wget to find used images
- Import media in bulk with caption and titles?
- wp media popup close all popup
- How do I display image files as links?
- Broken Media Library
- Unable to send upload url
- Is it possible to convert various image types from remote URLs to WebP and then serve them immediately?
- How to import and update images/galleries that point to an old site
- Media Library empty after server migration
- WordPress API, creating Featured Media from image url (nodejs)
- Uploading media to wordpress API with C# HttpClient
- Looking for a way to insert PDF image preview in TinyMCE
- Optimize blog that serves hundred of images and videos