Home Forums General Issues Conditionally autoload Local JSON for individual subsites? (multisite config)


Conditionally autoload Local JSON for individual subsites? (multisite config)

  • I am creating a network of sites in a multisite install of WordPress. All of these sites share the same theme, and should work nearly identical except for ONE of the websites where I need a custom Field Group to exist ONLY for that single site. So for six JSON files inside the theme’s /acf-json/ folder, I only want to load FIVE of them everywhere and load the 6th only for my “template/admin” site that all others are managed from.

    Local JSON seems like a great way to implement ACF across my network because it takes care of distributing the field groups for me, with far less overhead in the future if I ever need to make modifications to the Field Groups as well (no need to re-export + re-add the PHP to the theme, or re-export + re-add the JSON files manually to a location where I could load them from).

    Is there a simple way that I can let Local JSON do its job, but still do something like …

    if ( 2 != get_current_blog_id() ) { 
        // Skip loading one particular ACF Field Group 

    My searches of the documentation and google have come up fruitless, unfortunately, but I was hoping someone here may be able to help. Thanks!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.