Support

Account

Home Forums Backend Issues (wp-admin) ACF PHP Multisite repeated fields

Helping

ACF PHP Multisite repeated fields

    • klivie

    • February 14, 2020 at 4:58 am

    So we’ve built a WordPress multisite with 4 different sites setup.

    We are using a parent theme, and 2 different child themes across the sites.

    Recently, we’ve been doing some work on page speed and to help this we’ve switched over to using the ACF PHP config E.g. https://www.advancedcustomfields.com/resources/register-fields-via-php/.

    Now because the field groups were already setup and the field groups already contain data, as well as using different field groups per site. We’ve added the PHP config to both parent theme & the child themes. Obviously using the export tool to get our code.

    The problem we’re having is because we’ve added this config to the parent theme & child themes, it’s importing BOTH files for the PHP config.

    So we’re getting issues where some fields are duplicated, and some fields which are displayed are not required at all. e.g fields used on the parent theme but not required for the child theme.

    I can’t seem to think of any way to remove the duplicates, or to stop the custom fields on the parent theme being imported into the child themes.

    I was thinking of maybe using a conditional check on the blog_id before calling to my acf_add_local_field_group functions? Would this work? Do you have any other ideas?

    • amjad

    • February 14, 2020 at 11:45 am

    Use conditional check on blog_id on the php export file. That’s what I did too for a similar setup.

Viewing 2 posts - 1 through 2 (of 2 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.