Home › Forums › Backend Issues (wp-admin) › Getting Custom Fields to display › Reply To: Getting Custom Fields to display
Sometimes I run into issues with the detection of the post ID in the default loops. Might try manually passing in the ID and seeing if you get the expected values. Edited code:
<?php while ( have_posts() ) : the_post(); ?>
<h1><?php the_field('event_name', get_the_ID()); ?></h1>
<a href="<?php the_field('event_url', get_the_ID()); ?>">Test URL</a>
<p><?php the_content(); ?></p>
<?php endwhile; // end of the loop. ?>
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.