Archived topic
Best way to display data from a website "settings" or "options" page
3 replies · Started by Phil on October 6, 2021
In the past I've used ACF to create an Options page containing the main contact details of my client's business such as telephone, address, email address etc.. so that they can update them from one place in the future if needed. I'd then use ACF PHP code in various parts of the website template to display these.
I'd like to do a similar thing using the new Dynamic data options in GeneratePress site headers or blocks but I think I am correct in saying the dyanmic data bit is not designed to work with content on the ACF Options page? I've tried using ACF shortcodes with page_id="options" which doesn't always seem to work.
This got me thinking that I am probably over complicating things and there is probably a better or easier way to do this kind of thing!
How would you approach creating a single page or section in the admin panel for clients to update the main information for their website so this data can be used in the header and footer of the website and other sections using the GeneratePress / GenerateBlocks dynamic data feature.
Thanks, Phil :)
Hi there,
at this time the Block Element Dynamic Data only works with data stored on the current post. So although it will work with ACF fields on a current post it won't work with general options tables.
However, the Headline Block supports Shortcodes. So you could simply create an ACF shortcode to get your Options data and add it to a headline block.
Thanks Dave, much appreciated :)
You're welcome