Home › Forums › Front-end Issues › CPT Loop not returning get_field but does get_post_meta › Reply To: CPT Loop not returning get_field but does get_post_meta
Hi @Idealien
I see 2 issues with your above code:
1. Your post_meta function use the $post->ID, however your get_field does not
2. Your setup_postdata() function may be causing the issue.
Does your line work correctly:
$output .= "<strong>ID: " . $post->ID . "</strong><br/><br/>";
Can you also read over the WP docs to see some code examples of loops. Perhaps the get_posts function will be clearner?
Thanks
E
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.