Tips・WordPress custom fields (ACF / SCF)

A checklist for when ACF values don't show up

You entered a value in ACF (SCF) but it doesn't appear on the site—a checklist of causes ordered by how often they happen, from the wrong function to a missing post ID to a mistyped field name. Includes how to narrow the problem down.

You entered it, but it isn’t on the site—this is the single most common stumble with ACF (SCF). The causes come in a fairly fixed order of likelihood, so working down the list from the top narrows most cases down in a few minutes.

First, narrow it down: is the value missing, or is the output missing?

Rather than hunting for a cause right away, it’s faster to decide which side the problem is on. Temporarily drop this in where you want the value to appear.

<?php var_dump(get_field('price')); ?>
  • You get bool(false) or NULLthe value isn’t coming through. Check 1–5
  • The value prints, but nothing changes on the pageit’s an output problem. Check 6–8
  • Even the var_dump result doesn’t appearthis file isn’t being used. Check 9

1. The wrong field name (most common)

What you pass to get_field() is the field name (alphanumeric), not the label you see in the admin screen. Check the name printed in small text under the label in the “Field Groups” list.

  • get_field('Price')
  • get_field('price')

Underscore-versus-hyphen mixups (event_date / event-date) and a trailing space are common traps too.

2. Mixing up inside and outside the loop

get_field('price') fetches “the value of the current post.” So outside the loop—in the sidebar, the footer, an archive heading—there’s no current post, and you get nothing. Pass a post ID as the second argument.

<?php echo esc_html(get_field('price', 123)); ?>          <!-- specify a post ID -->
<?php echo esc_html(get_field('price', $post->ID)); ?>    <!-- from a variable -->
<?php echo esc_html(get_field('site_tel', 'option')); ?>  <!-- a value from an options page -->

For values on a term or a static page, name the target explicitly, as in get_field('name', 'category_5') or get_field('name', get_option('page_for_posts')).

3. Using get_field inside a repeater or group

Inside a repeater field or a group, there are dedicated functions. Get this wrong and you quietly get nothing, even with the right name.

<?php while (have_rows('faq')) : the_row(); ?>
  <?php the_sub_field('question'); ?>   <!-- ✅ the sub version -->
  <?php the_field('question'); ?>       <!-- ❌ comes back empty -->
<?php endwhile; ?>

For a group it’s open the box, then the contents, as in get_field('company')['tel'].

TipsHow to output an ACF group fieldThe right way to pull values out of a group field

4. The field group’s “location” rules don’t match

A field group has rules for where it appears (post type, template, taxonomy and so on). If those don’t match your target, the input fields never appear—which means no value was ever saved.

Start by looking at the editing screen to confirm the fields are visible. If they aren’t, revisit “Settings” → “Location” (the display rules) on the field group.

5. The plugin is inactive, or missing on that environment

If everything vanished after you uploaded to production, this is it. You moved the theme code but never activated the pluginget_field() doesn’t exist, so you get an error or nothing.

<?php if (function_exists('get_field')) : ?>
  <?php the_field('price'); ?>
<?php endif; ?>

Wrapping it in function_exists() stops the whole site from going down when the plugin is deactivated. It’s an especially worthwhile habit in themes you distribute or hand over.

6. You’re trying to print an array (you see “Array”)

Checkbox, link, group and repeater fields—and image fields whose return value is set to “Image Array”—are arrays. the_field() can’t print them directly.

<?php $link = get_field('button'); ?>
<a href="<?php echo esc_url($link['url']); ?>"><?php echo esc_html($link['title']); ?></a>
TipsACF field types: a cheat sheet for displaying each oneThe cheat sheet tells you what each field type returns

7. Tripping over “0” and empty strings

if (get_field('stock')) treats a value of 0 as “not there” as well. When you want to show zero stock or “$0,” compare explicitly.

<?php $stock = get_field('stock'); ?>
<?php if ($stock !== '' && $stock !== null) : ?>
  <p>In stock: <?php echo esc_html($stock); ?></p>
<?php endif; ?>

8. Forgetting to clean up after a sub-loop

After looping through other posts with WP_Query or the_post(), forgetting wp_reset_postdata() leaves later get_field() calls pointing at a different post. When “only the values below the list are wrong,” suspect this.

<?php $q = new WP_Query(['posts_per_page' => 3]); ?>
<?php while ($q->have_posts()) : $q->the_post(); ?>
  <?php the_title(); ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>   <!-- ← this one -->
TipsHow to fetch posts outside the loop (WP_Query)How to write a sub-loop properly, and how to clean up after it

9. That template file isn’t being used

The pattern where the file you’re editing isn’t actually responsible for the page. Putting a marker at the top is the reliable way to check.

<?php echo '★single.php'; ?>

If that doesn’t appear on the page, a different file in the template hierarchy (single-shohin.php, page-about.php, index.php and so on) is being used. Work out which file it is from your theme’s structure and the type of URL.

Theme developmentThe template hierarchy — each URL gets its own file in chargeWhich file handles which URL is covered in the template hierarchy lesson

10. Something is cached

A caching plugin, server-side cache or CDN may be serving old HTML. Opening the page in a private window, or clearing the cache, tells you. Two classic signs: it shows in the admin but not on the site, and you fixed it but nothing changed.

Summary

  1. Start with var_dump(get_field('name')) to decide whether the value is missing or the output is
  2. If the value is missing, check five things: field name, post ID, the sub functions, location rules, the plugin
  3. If the output is missing, check three: arrays, testing for 0, wp_reset_postdata()
  4. If nothing at all appears, suspect that the template isn’t being used—or a cache

Work down the list and you’ll catch it somewhere. Narrowing it down beats guessing at fixes every time.

FAQ

Nothing from ACF displays at all. What should I check first?
var_dump the field name directly to work out whether the value is coming through. If var_dump(get_field('price')); gives false or null, the problem is on the "can't get the value" side (name, post ID, plugin); if the value prints but nothing shows on the page, the problem is on the output side (an if statement, or the wrong template).
Values don't come through on archive pages or in the sidebar.
Outside the loop there's no way to know which post you mean, so pass a post ID as the second argument, like get_field('price', $post_id). For a value from an options page, it's get_field('name', 'option').
I can enter values in the admin, but they don't appear on the site.
Check whether the template file is actually being used. Temporarily add an echo at the top of the file you're editing and see if it shows on the page. If it doesn't, a different file in the template hierarchy is being used.
get_field works, but the_field prints "Array".
That field is one of the types that returns an array (checkbox, link, group, an image field set to return an array, and so on). Name the key inside it and print that.