Home › Forums › Front-end Issues › Field is not showing in Front-end
Hi
So I am trying to display a simple text field on the frontend of my WP theme without any results.
I am using this into my code
<div class="col-sm-8 col">
<h1 class="mg-md btn-resize-mode h1-style">
<?php the_field( 'headline' ); ?>
</h1>
</div>
And here attached some screenshot from the backend.
PS: I am using the ACF Theme Code Pro Plugin
What am I doing wrong?
Many thanks in advance!

I know nothing about the plugin you are using.
Is this code being inserted inside “The Loop” or is it inserted someplace in the page outside of the loop?
Is placed someplace in the page outside the loop
<!-- intro -->
<div class="intro intro-home" id="intro-home">
<div class="container bloc-lg bloc-md-lg">
<div class="row align-items-start">
<div class="col-sm-4 col col-360">
<img />/img/lazyload-ph.png" data-src="<?php echo get_template_directory_uri(); ?>/img/placeholder-image.png" class="img-fluid mx-auto d-block lazyload" alt="placeholder image" />
</div>
<div class="col-sm-8 col">
<h1 class="mg-md btn-resize-mode h1-style">
<?php the_field( 'headline' ); ?>
</h1>
</div>
</div>
</div>
</div>
<!-- intro END -->

When you are outside the loop then you need to supply the post ID.
$queried_object=get_queried_object();
the_field('headline', $queried_object->ID);
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!
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.