I have a custom image field that I am trying to insert into a custom Visual Composer module that someone wrote for me. The problem is that instead of the image showing in my front end it simply returns the text value of the image (Image Object, Image URL, or Image ID).
Unfortunately the developer is not available so I am trying to figure out on my own how I wrap the custom field in the necessary code that will allow to show on my page and also how can I tell WP to display a specific thumbnail size for the image?
If I change the field type to a WYSIWYG field and insert the image it works but I was hoping to use standard image field so the user’s GUI is not cluttered with unnecessary information or options.
This code should help you out if you are returning an image url
<img src="<?php the_field("image"); ?>" alt="">
Replace image with the field name that the image is stored in.
If you want to get a specific image image then set the following options.
Return an “image object” to the front end when the field is called
The image object option will return different properties and image sizes for the image uploaded. The image sizes can be accessed using the following
2022 was a big year for Advanced Custom Fields, with more capabilities, a new generation of ACF Blocks, a refreshed UI, and a new home. Our year in review post looks at advancements we’ve made and offers a glimpse of the future. https://t.co/HahJUCcyH4