I know I can use the Options, however I may have a unique situation, so any help would be awesome.
I would like to create a textarea (or more than one), specifically for a stylesheet. I’ve already done this before, however, in this case I would like to display that textarea on every page with updated live code.
In a nutshell, I have used repeater fields to create sections -> rows-> columns. Each has the option for an id and classes. So, ideally if while editing or creating a page, the user has access to update the css right there on the page and update it instead of having to go into the setting panel each time, that would be great!
Did you mean you want to do it on the front end? If you did, you can always use the acf_form() function. You can also use the acf/save_post hook and the update_field() function to update the value on the real field everytime you saved the form. To load the same value from the real field, you can use the acf/load_field hook.
I hope this helps 🙂
In that case, I think you need to create a custom location rule. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/custom-location-rules/. After that, you can load and update the field value like I told you before.
Hope this helps 🙂
Yes, it would be different on each page, but you can use the
acf/save_post hook and the
update_field() function to update certain custom field (i.e. the custom field in an options page).
You can also use the
acf/load_field hook to load the value from that particular custom field so all of the dummy stylesheet fields will show the value from the correct one.
Please take a look at my previous answers.
I hope this makes sense 🙂
You must be logged in to reply to this topic.
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.