I can already tell that you’re using ACF – if you don’t want to change the return settings for the field, you can bypass ACF and just pull the image ID directly from post meta:
$image_url = get_field( 'my_field_name' );
$image_id = get_post_meta( $post->ID, 'my_field_name', true );
$image_meta = wp_get_attachment_metadata( $image_id );
Related Posts:
- Displaying page image in the footer automatically
- Remove Dimension from wp_get_attachment_image
- Having different sidebar content for MANY pages?
- Change wp_get_attachment_image attributes (src and srcset) on specific custom field
- How do I make a custom field choose an image?
- Extend WP Customizer to make multiple image selection possible
- Add multiple images to a page sidebar
- Display thumbnail from custom field
- Add custom field to image editor
- Display info from custom fields in all images’ HTML
- automatically set “Featured Image” the same as the og:i that is set in a custom field
- copy attachments to another post type and change attachment url
- limit amount of photos uploaded per cpt post
- How do I read the value of a custom field of the page?
- Advice needed for importing custom field data and database structure
- Metabox with multiple fields added by user and upload box
- Add WYSIWYG to Image Description field
- Add url from Custom Field as ‘Featured Image’. Code not working
- How to display multiple images in custom field
- How to add image attachment to post from a single meta key (Woocommerce)
- Exclude images uploaded via meta boxes from WordPress gallery
- How to add the image URL from an external RSS feed and insert into a custom field?
- Add new image block, set default class name and update it using Javascript
- Better way to save image in custom field
- How do I add an image upload, custom field to a WooCommerce product?
- Limits, not all post are showen when querying for posts by view count
- Custom fields attached to a page template only show on edit screen when page is saved
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- Select multiple images from custom field
- remove initial wysiwyg editor from cms page edit
- Get image url using image id
- Hide text if one custom field out of two is empty [closed]
- Show image if author meta (profile fields) exists outside loop
- Convert attachment ID into url?
- How to display a product features dynamically with icons?
- Custom field as featured image caption
- Display a different image for each page with editor
- Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
- Image upload and path to custom field
- How to get custom image field of specific post id
- How do I include a template file while allowing it to render its own dynamic content added via custom box?
- Selectively hiding or allowing thumbnails of featured images on front page
- wp_get_attachment_image_src() with advanced custom fields returning empty
- Unable to select image with custom field
- Users uploaded image and matching an id or taxonomy
- show a specific metabox dependent on the page template
- Adding Facebook’s image and meta description retrieval capabilities to a WordPress post
- Show image depending on the number in the custom fields
- How to delete attachments associated with custom field type when post property changes? [closed]
- Load one page with parent and child pages
- Use a different catalog image than the featured image
- How to add custom fields to images for image source text and URL
- Page template is missing fields or is invalid when I updating the template
- Append custom field items to content from plugin
- Get first URL from custom field, download and set as featured image on post publish
- Display Child Page with custom fields within Parent Page
- Change path to child of page when uploading image via custom field
- Create download page from post option link
- Edit different parts of a page seperately
- Analyze uploaded images to get colour values
- Adding thumbnails for non-image attachments
- Group pages by custom field values
- Upload image to wordpress
- Get custom field from page, in a post?
- Undefined Variable (Displaying image via custom field)
- Multiple image uploader under editor?
- Get single image from custom fields made with WCK custom fields creator
- Add image custom attribute [closed]
- How to mark a image attachment as background image?
- Crop custom image size vs actual size
- Add a Jquery Datepicker to custom field in post edit
- Order Posts by Closest Numeric Values
- Create additional short URL with custom field and 301 redirect
- Using custom fields in a filter hook
- Function to change meta value in database for each post
- Include woocommerce custom field value in front-end search result
- How do you create dynamic customised sections in WordPress?
- How to enable Custom Fields that are disabled by theme?
- how can i stop custom fields that have apostrophes from breaking my code
- WPML & CFT: keeping custom field file to translation
- How do I Implement Atomic Update of Post Metadata?
- Custom fields value
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Want to make A CSS if meta key value is empty
- Problem with saving large amount of data in postmeta/usermeta
- How to get posts with a metadata numeric key greater than X?
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Get text from user and display it on page
- If metabox has content display content
- Custom meta boxes not saving
- Listing the most popular 8 city (custom fields) as used in posts
- How to delete file uploaded by Plupload
- Display Meta Data with HTML?
- Delete user meta but only if found in array
- meta_query to check all custom fields
- Show Custom Taxonomy as Headline for related posts
- display Flexible Fields from options
- custom fields not showing before get_header
- Advenced custom fields auto fill problem
- Truncating characters in Advanced Custom Fields works some places but not others?