Home › Forums › Front-end Issues › Data from the_field doesnt show up on the right place › Reply To: Data from the_field doesnt show up on the right place
Yes, it is. Sorry, but you are using the wrong function. The values are in the wrong place because they are echoed at the point where the function the_feild() is called.
Example:
// this will output the value of a field here
// and set $value == NULL
// because the_field() does not return a value
$value = '<p>The value of the field is echoed here ('.the_field().')</p>';
// this will echo the <p> with nothing in the ()
// because the_field() already echoed the value above
// and returned NULL
echo $value
I won’t go into the issues with using ‘the_terms()’ in the context that you are attempting to use it. Removing that from one of your lines what it should look like is this
$ouput .='<div>'
.'• Erscheinungsdatum:<span>'
.get__field('produziert')
.'</span>• FSK: <span>'
.get__field('fsk')
.'</span>• Filmlänge: <span>'
.get__field('filmlaenge')
.'</span>• Schauspieler:'
.'</div>';
echo $output;
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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.