1

I would like to be able to add Gutenberg blocks to an ACF options page. I've been doing quite a bit of researching but have found nothing. For instance it would be nice to have a footer block and have it rendered/previewed on the "Footer" options page like it would be on the front end. Anyone know if this is possible?

3
  • I can't see any way to add editor support to the ACF options page. If previewing the footer is important, then might I suggest you use the customizer to do this? It doesn't let you move blocks around, but it will render in the preview screen.
    – Faye
    Oct 10, 2019 at 23:47
  • Any update on this? I'm using ACF option page to add fields to my custom post type archive page.. would be great to use Gutenberg here.. Apr 8, 2020 at 12:10
  • @user3405376 I have been using the plugin "Reusable Blocks Extended" to achieve what I needed. It's a great solution.
    – bl0cklevel
    Apr 9, 2020 at 13:31

2 Answers 2

1

Create a page named as your archive, add blocks there. In archive-name.php please add:

<?php get_header();

$page_id   = get_post( 57 );
$page =  apply_filters( 'the_content', $page->post_content );

echo $page; ?>

<?php get_footer();

Replace '57' with your page ID. Now you can manage content of archive page directly from Pages.

1
  • Yep, I'm aware of the work arounds to the issue. I was just hoping there was a way to accomplish this within the scope of an actual ACF Option page. Thanks for the input though!
    – bl0cklevel
    Oct 8, 2020 at 19:15
0

Another workaround but maybe useful to others: I use a custom post type called "Globals" to store block templates used for global sections of the site such as footer.

It would be nice to be able to use an options page but I don't think its possible at the moment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.