The featured image attachment id is stored in the post_meta table, with the meta_key _thumbnail_id
.
Use that post id to find the post meta with meta_key _wp_attachment_metadata
.
The value of that is a serialized array with keys thumb
, file
, width
, height
, sizes
(an array), and image_meta
(an array).
The file
value is relative to the uploads directory for the WP install, and points to the original full-sized image. You should be able to calculate the URL from that.
sizes
has an image size as its key (e.g., ‘small’, ‘medium’, ‘large’, ‘thumbnail’), and the value is an array with keys file
, height
, and width
.
image_meta
will contain things like exif/iptc image metadata from the image itself.
Related Posts:
- Regex to turn embedded images in to attachments
- Upload media only to DB
- Disable save as image on smartphones using all browsers ( chrome, firefox, ie, cm, opera )
- Using mysql to replace img src?
- SQL: How to find all attachments that are not used in any posts/pages/custom_post_types
- How do I delete all UNUSED images from my uploads directory?
- Download an image from a webpage to the default uploads folder
- Featured image shortcode
- How to find attachment by it’s name?
- Change html structure of all img tags in WordPress
- Theme Customiser Image Control
- How to disable “insert into post” only when selecting the Featured Image?
- Is there a way to define a default caption to all uploaded images
- How can I add the “Use as featured image” to a custom metabox?
- How to increase media image scale limit?
- Dynamic-Image-Resize Plugin does not output anything
- How to output placeholder image if no featured image set?
- Cannot access the thumbnails of attachment images… Cannot find the reason
- How to place an image into header.php? [closed]
- Uploading an image as featured image from frontend form
- @wordpress/create-block image url in css
- How does WordPress work out the srcsets?
- How to include a picture in a blog post such that it will show in Facebook?
- Remove ‘wp-content/themes/themename/’ from Image path
- Why html tags are being appended to my pictures?
- Restrict Image Uploads to a Certain File Type
- How to create a simple slideshow out of a post image gallery?
- wordpress media library shows empty images
- How to change the target size of images clicked on in WordPress standard gallery
- Adding different backgrounds for different pages
- Mobile Featured Image Bug
- How to display alt tags in img src?
- If Media Type .GIF
- Migrate image from my old blog
- the_post_thumbnail() image sizing problem?
- Imagick vs GD colour issues on image uploads
- How to add image and featured image to post by WP REST API
- Jetpack’s photon causes local site to try and serve images from WordPress CDN [closed]
- How to stop wordpress always displaying full-res images
- Resize images in existing posts
- WordPress PNG compression issue
- “Unable to create new image” error in wordpress dashboard image editor
- Fallback image size when using wp_get_attachment_image_src / full size compressed image
- Rewrite all article pictures to link to file
- Upload box media size not working
- Featured images disappear after DB export/import?
- How can I add a ‘Click to Enlarge Image’ feature, with the enlarged image opening in a popup?
- Is there a resolution limit in image resize?
- Setting default image size
- Automatically Insert alt attribute above image has h2
- Rebuild thumbnails via WP Cli – how?
- Images uploading from media going in wrong folder
- Row background image not showing in mobile browser served from wamp local host
- Get ID for previous/next image link
- Changing Image Size Settings does not show in Image Details
- adding image to post thumbnail from another server
- Logo is not being displayed in header (Twentytwelve)
- Set Featured Image not opening – Stuck at loading
- Get the URL, width and height of an image where the width and height are a specified minimum
- Simple Local Avatar Plugin
- Pagination between images (active/inactive)
- Metabox image upload value
- Always display a picture even if the link is broken?
- wp_get_attachment_image – enable width and height attributes for an SVG image
- How to remove image size inline style in article and include caption
- Is there a layout to place 2 same sized images in two columns on the WordPress page?
- How to change an image source when rendering on frontend?
- Do I need to re-register all my images in the media library after a migration?
- How can I change the header on the pages?
- still need help-images inside wp-content/ uploads/ are not showing up in my media library and uploaded using FTP protocol
- ADD class to all my images (thumbail)
- How to show a full page when someone links directly to an image on my site
- Export wordpress image ID based off keyword search
- Post Images are not showing up whenever I use shortCodes in my posts
- How can we achieve this image css style?
- Adding a URL Parameter to JPEG images in posts
- How to Make Only Images Connected to a Post Show? Not Entire Media Collection?
- Bypass wp_safe_remote_get()?
- Delete post if featured image is smaller than Y pixels by Y pixels
- How to use lossless compression with WP_Image_Editor
- Redirect Causes Missing Images
- Edit image itself
- Url link to feature image in the portfolio [closed]
- How Do I Auto Generate Thumbnail from First Embedded Image?
- Exporting a portfolio with pictures
- Protocol relative url not pulling up images on IE, FF, and OPERA
- Retaining original image size
- Rename uploads filenames to POST-ID on upload
- Transfered live site to new server and images are not showing
- Limit files uploaded per folder
- Imagem resolution responsive
- How do you hide images from posts only
- WP is showing wrong image dimensions
- Bug when uploading pictures with Arabic name characters?
- Changing logo image in header.php upon language detection
- Hover images and Videos
- How to add a link to media file for every image inserted in content?
- How to get WordPress to resize images for srcset?
- Export Woocomerce Image Product URL
- Edit multiple posts featured image