Home › Forums › General Issues › get_field('field', $page_id) not returning a value. › Reply To: get_field('field', $page_id) not returning a value.
I can display the custom field on the page with the ACF option for my text element.
-> this will display 15, hence my conclusion that the field has the correct value.
But I can’t use that ACF option of the text element to put that value as a parameter on the shortcode.=> As in I can’t print/echo the id into the actual shortcode, if this would be the shortcode [shortcode id=”?”], then I can’t get the ACF value on the ? as I can only get that with the text element (which is a shortcode itself).
So I need to get the field via the page id within the shordcode code.
var_dump gives me: NULL
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.