I’m still having some issues with ACF. Currently we have some custom fields that are added to each blog post. I’m having issues with getting the values to display on the frontend blog post sidebar. The sidebar is the same on all blog posts, and the ACF values should display.
If i place the shortcode inside the actual blog post, it will display.
The issue you had mostly occurred because you were trying to execute the get_field() or the_field() function outside of The Loop. To fix it, you need to pass the post/page ID as the second parameter to the get_field() or the_field() function like this:
Thanks for the reply! I was able to use the shortcode [acf field="header_title" post_id="350"] in the sidebar and it displayed correctly. However, we’re using PHP and need the post_id to generate automatically since we cannot enter it manually for each sidebar/post. Is this possible?