Home › Forums › Gutenberg › Look to access ACF Gutenberg block content outside the loop › Reply To: Look to access ACF Gutenberg block content outside the loop
echo apply_filters( 'the_content', get_post_field('post_content', $id ) );
Replace $id with the ID of the post with the blocks you want to include. I’ve created a “header” and “footer” custom post types which I use solely for storing specific blocks I designed for said parts (which basically allows me to grab the desired “header” and “footer” posts/blocks from wherever I want).
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.