There’s no need to store the URL in a custom field, the thumbnail id is already stored in a custom field under the key _thumbnail_id
. You can fetch the ID via get_post_meta
and use wp_get_attachment_image_src
to get the URL.
Related Posts:
- How do I Add images uploaded in the post to a default custom field
- The the_post_thumbnail without srcset?
- Get the first image from post content (eg.: hotlinked images)
- Unexpected width and srcset attributes for the_post_thumbnail();
- How to set dimensions of the post thumbnails (featured images)
- Cannot get full thumbnail size using the_post_thumbnail
- Custom Field returning Numerical Value for Image rather than URL
- Reasons why all thumbnail sizes aren’t working
- Redirect to another page using contact form 7? [closed]
- How To Pick Custom Size Of Uploaded Image In Theme Via the_post_thumbnail();?
- How to disable thumbnail filter for a specific template part or image size?
- How to make excerpt image be full size instead of thumbnail?
- How can I scale down the width of images in bulk that are embedded in posts throughout the site?
- theme directory fallback image outputs url and not the image
- Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix
- I want to resize post featured image without cropping image. How?
- WP “optimizing” PNGs into thumbnails 5X larger than originals – FIX
- optimized PNGs 5X larger than originals
- WordPress Theme Preview Image
- How to add a checkbox element to attachments editor with example
- How to modify an image block in Gutenberg WordPress 5?
- How can I set image sizes and still have responsive images using the srcset attribute?
- Add default Backgrounds
- Edit srcset and sizes attributes in Gutenberg image, cover and gallery – blocks
- How to add a 2nd “featured image” to a post?
- wp_get_attachment_image_attributes not working for me
- Specify image dimensions
- How to get gallery images?
- How to change post thumbnail title and alt attributes to post title?
- add_image_size is scaling, even though crop is set to true
- Featured Image in 4.4 should be larger on mobile device
- How to use the responsive images feature from WP 4.4 in your themes
- Confused about image sizing business in WordPress
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Responsive class to all the images in the content
- How wordpress handle upload images and how to use them in the code
- Change loop order via form or link (jquery, not URL)
- How to handle thumbnails
- automatically set “Featured Image” the same as the og:i that is set in a custom field
- Replace Home with image link inside custom header menu
- Featured Image Size
- Change display of featured image for pages in twenty seventeen theme
- Why is unfiltered html allowed in custom fields for author / contributor roles?
- How to regenerate thumbnails when they’re stored on S3
- Using the theme options to change background
- wp_editor() usage in custom meta box
- wp_get_attachment_image_src() width and height boolean
- Add url from Custom Field as ‘Featured Image’. Code not working
- How to float an image in Gutenberg
- A mystery 300px image size
- Can’t show custom post thumbnail sizes as background images
- Custom post fields
- Featured Images are not able to be set
- Why an arugment is missing in wp_get_attachment_image_attributes?
- Display recent posts with thumbnail
- How to make a local cache of mshots images
- attachment.php code or tutorial
- Change “Thumbnail”, “Medium” and “Large” image sizes using functions.php?
- image url relative path not working in css file
- Default image size not working
- Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox
- How do you replace content generated by custom fields with custom blocks in Block Editor?
- How do I build a post_thumbnail based archive? [closed]
- WordPress Media Uploader in page template (On Front-end)
- Sort wp_query by sum of two meta fields
- What’s the best practice way of handling custom fields in different post formats?
- Responsive Images – crop don’t seem to work
- Custom page template with custom fields
- How do I include pre-installed images in a theme?
- How do I turn a post thumbnail into a background image?
- Reactor Theme: Prevent Post Thumb on Post
- Inserting images in multiple posts native gallery
- Can I get the ID of an inserted / linked image?
- Add attachment for all images in post
- Changing Header Image Every N Minutes/Seconds
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- Do not display post images on front page
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Gallery thumbnails very small
- Featured Image meta box not showing up
- Where WordPress Stores The Custom Fields Values
- How do I remove inline style in featured image markup?
- How do I keep images in posts below a certain size without editing the post?
- Add custom field to existing meta box?
- the_post_thumbnail fetches wrong image
- apply_filters to featured image
- Custom image size doesn’t work
- Retina ready for uploaded images which are cropped
- Show post thumbnail only if it exists using timthumb
- Add rel to all images in a post
- Display Page featured Image as well as Posts featured Image
- How to mark a image attachment as background image?
- Add Field To All Pages
- How can I add a single image from a gallery into the page header?
- Isotope overlapping .items because of featured images – HELP! [closed]
- Custom Theme functions.php – Using add_settings_field and input type=”file” to set custom logo
- How do I work with responsive images in WordPress? (img srcset/sizes)
- Crop custom image size vs actual size
- Convert base64 string to WordPress attachment uploads multiple images instead of a single one
- add_image_size() parameter four ($crop = true) is ignored: the_post_thumbnail() returns scaled image(s) instead of hard cropped