In WordPress attachments are treated as posts, with their own titles, excerpts and metavalues. So if a post has an attachment there are two sets of metavalues, one for the post itself and one for the attachment.
You are using update_post_meta( $post['ID'] ...
to store the url. So it is stored as a metavalue of the post.
You are retrieving with get_post_meta(get_post_thumbnail_id() ...
, so you are looking for a metavalue of the attachment. To retrieve it you must not use get_post_thumbnail_id()
but $post['ID']
, because that’s where you stored that url.
Related Posts:
- add_image_size() for specific Post Types
- How to disable generation of default image sizes for some custom post types?
- set_post_thumbnail_size in percent, not pixels?
- How to add multiple featured image in meta box in post editor?
- add_image_size for post type
- Change post featured image on hover
- Custom Image Thumbnails of Different Sizes
- Link to full size post thumbnail
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- How to Create an Image Upload Box for Custom Posts?
- Redirect to another page using contact form 7? [closed]
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- Using Image Sizes for Custom Post Types outside the Loop
- Thumbnails Not Generating
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- img src not working correctly in custom post type
- Front end post or photo or both
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?
- Remove slug from custom post type post URLs
- Custom Taxonomy as checkbox or dropdown
- Why won’t my metabox data save?
- echo value from ‘select’ field type into page template using cmb2?
- WP_List_Table Inside Metabox Not Working on Submit
- Custom post type Admin Page
- Add metabox with media uploader in a custom post type [duplicate]
- wp_generate_attachment_metadata gives me an empty array
- WordPress Custom Post Type Category Page
- Best way to arrange custom post types by Attributes -> Order metabox value?
- Removing Edit Permalink/View “Custom Post Type” areas
- Unable to save custom taxonomy terms in a custom-built metabox
- Possible to add meta box to edit.php pages?
- How can I include meta box content when searching?
- How to use different featured image size for a custom post type?
- reference the current category being used in the category.php page
- How to rename image at uploading on specific plugin or post-type in WordPress
- How can I display my custom metaboxes on a custom post template?
- How to insert multiple images into a single post within a CPT
- Custom Post Type with metaboxes (no content) only?
- Show Post Thumbnail In Custom Post From Other CPT
- Unable to show meta box data in frontend
- Custom Post Types, URL rewrite on multiple CPTs
- Is it possible to create relational metabox values in a custom post?
- Changing custom type name hides the posts
- Remove the parent slug in a CPT URL
- WordPress randomly shows 404 errors
- Adding Page Templates to post but it ignored it
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Fixed values for same post translations
- How do you create a custom template to display a category with an image and related posts below?
- How can I move (or create another) publish button?
- Wrap meta boxes & data handling for specific post types in classes?
- How to handle large number of images in a post?
- Meta Data for Custom Post Type not saving
- Remove “show sharing buttons” metabox Jetpack from custom post type
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- How can i link a custom post type thumbnail to intermediate size
- False Positive on has_post_thumbnail
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- Custom post doesn’t show featured image
- What do the numbers mean at the end of add_action(‘save_post’)…?
- A meta box (in a custom post type) with two different type of fields
- Unable to display selected post title in frontend from metabox wp_dropdown_pages()
- Custom Meta Box returns no HTML
- Topic won’t save for a custom post type — how to debug?
- Reusable metabox backend and frontend
- How to display wp_post by custom field value?
- How can I output WPAlchemy repeating fields meta values in my page template?
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- Meta box data not saving
- Questions regarding add_meta_box()
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot upload featured image to a custom post type
- Should i use custom post type for a custom footer?
- Metaboxes inside Tab
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- insert og image link in wordpress post
- Show a custom post title in another custom post type in Meta box
- PHP Warning with Custom Fields
- Custom taxonomy with custom post type archive page
- Wrong post ID in meta box callback
- Remove wp directory and slug for custom post type from the URLs
- wp_dropdown_pages doesn’t allow me to select more than one custom post type
- Delete custom post type metadata without deleting the post in admin area
- Metabox is not saving
- Trying to get custom post type attachment images to function in indexed array
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Custom Post Type Categories Not Maintaining URL structure any more
- Category slug not showing for Custom Post Type
- Select custom post by meta value
- Why are my wp urls showing page not found?
- Sorting custom post types by taxonomy (So close)
- Custom post type – permalink
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- How to query custom post then display sections by meta value
- Display div based on Group metabox selection [closed]
- Add a background image into a post [closed]
- Delete old thumbnail when updating new
- Is it possible to use a post name in a custom post slug?