I’m a bit of a noob to this plugin, but am having some issues showing the an image from a custom field.
The field is registered, the image is uploading fine, but when I`m trying to display the image I get :
<img src=”” style=”display: block;”>
It isn’t returning the URL.
My call is:
<img src="<?php the_field('footer_1_1'); ? />" />
and my field is registered as follows:
Any help appreciated
Sorry, should have been more clear. I need more information on the field/field group. Where do the location rules say the field group appears. Where in the code of your template are you trying to get the value? For that matter, what type of template are you trying to get the value in (archive? single?)?
Is the field where you add the image on a post editor page for his custom post type?
If it is, is the call
<img src="<?php the_field('footer_1_1'); ? />" /> inside “The Loop”
Oh wow. The mention of The Loop is definitely my issue.
The location is “if Post equal to Footer Logo” (my custom post type)
I am actually trying the pull the field data from inside of a PHP widget (located in my footer).
Now that you have mentioned The Loop I realize how silly this is. I’m a beginner, forgive me.
How can I go about calling the field from a location such as a footer widget?
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.