Home › Forums › Backend Issues (wp-admin) › Keep custom fields inside specific site/child theme in multisite
Hi there,
I’ve got ACF (Pro) installed on a multisite, which has a custom parent theme with some custom child themes on a couple of the satellite site.
Under the main site I’ve got some custom fields installed and showing up on every site (intended), however I’ve also created some custom fields on the satellite site (which is using a child theme), and the fields created there are showing up on all other satellite sites, and across other child themes (not intended).
Is there a way to keep the custom fields which are created specifically on one satellite site (and child theme) only showing up there?
Some other details:
Found this related question (after relentlessly changing search parameters):
https://support.advancedcustomfields.com/forums/topic/multisite-location-rules-display-field-groups-on-specific-sites/ and got my answer in the question, didn’t even know rule matching filters existed!
My sites live on subdomains, so I preferred to change the display list to use the blog (site) name rather than either their subdomain or path (mine were all “/”), so in the acf_location_rule_values_multisites
function, I changed the the loop to show names instead.
foreach( $sites as $site ) {
$name = get_blog_details( array( 'blog_id' => $site->blog_id ) )->blogname;
$choices[ get_object_vars($site)["blog_id"] ] = $name;
}
Note I put this function in the parent theme, child theme alone would’ve prevented it showing on other satellite sites not using the same child theme.
I’m still choosing to make the field groups on each satellite site, though they are appearing available to sync on all the other satellite sites, though I can either just hit sync and have them all in (which shouldn’t matter since they’ll only show on the correct site anyway) or ignore them when syncing everything else to keep it clean).
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!
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.