Home › Forums › Front-end Issues › ACF in a widget › Reply To: ACF in a widget
Hi @sirblogalot
It is most likely an issue with scope.
When you use get_field or the_field in the normal page template, they have access to the global $post object and can find the correct $post_id to load data from.
Within a widget, however, the functions may not be able to find this global $post object. Perhaps you could do some testing in your code to see if this object can be found and if it’s ID is the correct value.
good luck
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.