Home › Forums › Backend Issues (wp-admin) › Theme-specific location rules › Reply To: Theme-specific location rules
If I was going to do something like this, starting at the beginning and knowing that I would be moving to a multisite setup……..
I would start by setting up multisite and I would create a “master theme” where I would create all of the field groups. This master theme would have an acf-json folder so that when I made changes to a field group the changes would be saved in the json folder. Without doing this you would need to import the field groups to each them anyway, so you would not have a master location for maintaining all the field groups.
I might actually create the acf-json folder in the root of /themes/ rather than in the theme and then use the custom save and load points in ACF to https://www.advancedcustomfields.com/resources/local-json/
$path = dirname(get_stylesheet_directory()).'/acf-json';
In each of the other themes I built I would create my own function to load the field groups that are needed for each theme from this master theme json folder using a variation of this https://github.com/Hube2/acf-filters-and-functions/blob/master/acf-load-parent-theme-field-groups.php… this was something that I created either before acf allowed multiple load points or before I realized they existed. I keep it around because it’s a good reference. I would only load the groups I needed, filtering by the group key.
My goal would be to limit the number of places that these field groups existed and this would limit it to 1 locations and one place where they could be edited.
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.