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
- Using Custom Fields to Trigger Specific Actions on Saving a Post?
- Display Additional Info
- how to create meta key name in wp_usermeta table in database
- Redirect DRAFT Posts to a Custom URL (Custom Field) : Currently 404 Page
- Display the output from Custom User Fields from a WordPress user profile on a WordPress Custom Page
- ACF get_sub_field ALT TAG in the repeater doesn’t show
- How to use custom fields like Title to show value in content?
- Populate custom checkout fields with data from previous orders
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- Meta field bulk editing no longer working in WP 6.0 [closed]
- How do I upload file through custom field, save it to database and get it
- Can export gallery but can’t import it Wp all import
- Get Custom Field Name ( Label or Key ) Not Value
- Compare ACF date field (if exists) and post date and order DESC
- How To Save Data From Remote APIs To ACF?
- Custom Field: how to save array of multiple key-values in WordPress
- comments_where Hook
- Custom field on Quick Edit using select/dropdown – almost working right but not showing currently selected value
- How can I detect user’s timezone?
- Rewrite comment form post ID on submit
- Add WordPress user custom meta to chartjs vertically stacked chart in Divi theme
- ACF field group not showing in page
- excluding posts by an ACF field in pagination
- Type character in name and make it invisble
- Filter post style attribute
- What am I missing in this Code Block?
- Making WP_Query limit results by date before today where date is a meta_query
- add_comment_meta not working properly
- how to enable custom fields in the Gutenberg post editor
- How to show ACF fields in Gridbuilder custom block