I am using Advanced Custom Fields with Wordpress. I have set up a field and can display it on my homepage/front-page.php template like this...
<?php the_field('primary_tagline'); ?>
I want to use the same field on my page.php template, but when i drop in the same code, no results are returned. I don't understand why it works on one template but not the other. Do i need different code to show the same field results across multiple templates? Here is the code...
<?php the_field('primary_tagline'); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content', 'page' ); ?>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; ?>
</main><!-- #main -->
</div><!-- #primary -->
Is it a loop problem? ACF won't show outside a loop?