Home › Forums › General Issues › Image Field Return URL not Working › Reply To: Image Field Return URL not Working
Hi @vinex08
Yes, you can use PHP within the style attribute.
PHP is a serverside language that is compiled before the HTML and then returned to the browser (client).
Your code looks fine, the only issue may be where the data is being loaded from.
If your home page contains a custom loop, this will affect where ACF will load data from. Perhaps you will need to specify the page that you want to load the image from via the the_field second parameter.
You can checkout the docs for more info on thei paramter
Thanks
E
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.