Home › Forums › Front-end Issues › Display Image URL on Archive.php do'nt Work › Reply To: Display Image URL on Archive.php do'nt Work
in this part of the code
...style="background-image:url(<?php the_field('titelbild2'); ?>);...
You are not inside of the loop so you need to provide the post id. Is this image on an options page? A post? A term? somewhere else?
Assuming that it’s on an options page then it would be the_field('titelbild2', 'option')
. If it’s somewhere else the you need to us the correct post id for that location. This is explained here http://www.advancedcustomfields.com/resources/get_field/ under “Get a value from other places”
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.