Home › Forums › General Issues › Generate sub field from php – check if content already exists › Reply To: Generate sub field from php – check if content already exists
You are trying to get the values from the current post? or are you trying to get the values from some specific post?
If it’s from the current post, the reason that the above isn’t working is probably because it’s in a function? and inside a function the values used to create a post loop don’t exist.
Try adding this to the top of your function
global $wp_query, $post;
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.