Archived topic
Get ACF from page options to Hero block
11 replies · Started by Jordi on July 1, 2021
Hi, I created some fields with ACF and assigned them to "Options page". Now I want to create a Hero with generatebloks. Is it possible to get ACF fields to view them in Hero?
Thanks!!
Hi Jordi,
It should be possible with GP Premium 2.0's dynamic settings on Block Element - Page Hero.
Here's an example: (Setting dynamic background image taken from ACF field value)
https://share.getcloudapp.com/yAurJB0O
All GenerateBlocks have dynamic settings within Block Element. :D You can set whatever field you wish to fetch on this setting.
Hi, thanks for the reply.
Yes, but if I assign the ACFs to the "Options page", how do I display them?


Thanks!
Yes those settings are correct.
Just make sure the field type is set to "Image" and actually returns an Image URL.
https://share.getcloudapp.com/E0uAXe7m
Yes, but it still doesn't show the image.


Hi there,
can you add a background image to the Container Block within the post editor - there has to be a background attached for the Dynamic Background to work.
Yes, I have already added a background image but this still does not show the dynamic image.

-----------------

-----------------

-----------------

-----------------

In this space there should be the dynamic background image.
Can you share a link to where i can see the block being output ?
Okay, I'll send you it.
I am not sure - but i don't think this will work from an ACF options page, according to the ACF docs:
https://www.advancedcustomfields.com/resources/get-values-from-an-options-page/
It requires the equivalent of a $post_id to be part of the get_field request.
The GB Block element would expect the Custom Field to exist on the actual page or post.
Hi,
Following up on this.
Is there any possibility to call a field from an ACF options page.
For example, creating a footer element with social icons (each with a link), I would like the links to be dynamic and populated from the ACF options page, and not statically inserted to each icon.
Thanks
Dan
Hi Dan
I responded here:
https://generatepress.com/forums/topic/acf-options-field-for-off-canvas-menu/#post-2204627
Short answer - no using a GP Dynamic data setting but yes using ACF shortcode/block