And thank you so much for your suggestions… you are helping me think of things I haven’t tried yet.
Gotcha. Okay that makes more sense. LOL. So, I had tried putting it on the template before with no luck. Now I get my UL dot, but no values are pulled in. My HTML is:
<h3>Website Features</h3>
<?php
$site_features = get_field('site_features');
if( $site_features ): ?>
<ul>
<?php
foreach( $site_features as $site_feature ): ?>
<li><?php echo $site_feature; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
And, I get this:
This is how I have the code in the functions.php file:
$site_features = get_field('site_features');
if( $site_features ): ?>
<ul>
<?php
// notice the missing "s"
foreach( $site_features as $site_feature ): ?>
<li><?php echo $site_feature; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
I was able to bring the field back and get it to finally show up on the front end, but this is how it is outputting (with commas):
I’m hoping to output that as an unordered list instead.
Sure. I understand. This is the way I have the field setup:
Yes, I did try that earlier today, with no luck. Was just trying to follow what that page link said and I noticed their missing “s” in some places. At this point, ACF has entirely quite offering any output at all in my template. (unordered or otherwise) I have obviously flubbed something up.
So, excuse my newbie-ness, but what variable am I supposed to use and where do I get it from?
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.