Support

Account

Home Forums Front-end Issues Embedding ACF Image into WordPress Image

Solving

Embedding ACF Image into WordPress Image

  • What I’m trying to do is fairly simple but seems rather hard to connect for some reason. I want to have a dynamic image populate on my product pages. I have the images loaded on the server and can reference the image URL based on the product. Using WP Sheet Editor I basically uploaded the URLs of the images per product as an ACF field.

    However when I try to use the dynamic image feature it won’t show any images. What am I doing wrong? Is there anyway to simply reference the image URL in html code via shortcodes to simply show a single picture on the page?

    It seems this should be straightforward but isn’t. I see the image field populate on the product edit page where I can manually upload an image but I have 18,000 products and need to do this at scale. The URL used when I manually add an image to a product page and an ID attached to it. I just need to know how I can properly update my bulk sheets to ensure the image can be referenced properly on the front end using either the image widget or html code per product ACF image field.

  • The most likely cause of this is that WP Sheet Editor is not compatible with ACF and is not saving the values for the image fields correctly.

    ACF image fields are saved in the DB as the image post ID. In addition to this, like all fields, ACF requires a field key reference in the DB.

  • @hube2 thank you for your help! Is it possible to use ACF somehow to show images based on an image URL? I can store the URLs per product as long as I can reference it and have the image show on the frontend using ACF. Any ideas?

  • You cannot use ACF if the value is not stored the way ACF expects it to be stored or the field key reference is missing in the database.

    My first step would be to contact the developers of, or look at the documentation for WP Sheet Editor and find out if there are any hooks during the save process of that plugin that would allow the possibility of making the saved values compatible with ACF.

  • @hube2 I think it can be simplier than all that because ACF allows for simply a URL field right? So is there a way to add the image URL into that field and then reference it on the front end via some html+shortcode combination? The question really is can I generate an image using a url pulled from an ACF?

  • Here’s the thing, you cannot get an ACF field that does not have a corresponding field key reference in the database. There was a time that this was possible. ACF has changed this so that fields that are not defined by ACF cannot be retrieved by ACF as a security measure.

    Your next option would be to use get_post_meta(). This would work around ACF. Then you could build a custom shortcode to get the image ID or URL and go from there.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.