Home Forums Backend Issues (wp-admin) Problems including ACF in my theme Reply To: Problems including ACF in my theme

  • Try increasing the priority for the admin. There could be another filter that overriding yours

    add_filter( 'acf/settings/show_admin', '__return_false', 20 );

    For your fields, try a different hook

    add_action( 'acf/include_fields’', 'zephyr_acf_add_local_field_groups', 1 );

    This may not work. This issue is usually caused by some other plugin or some other code that is trying to get a list of field groups or fields before you are trying to include your fields. What happens is this: when they get the fields ACF puts the fields into the WP meta cache. Then you you add your fields the cache is not cleared. The next time the fields are retrieved the cached version used which does not include your fields. The first thing that I’d do is figure out if there is something else that causing this. If all else fails you can attempt to clear the cache before you add your fields, however, this may cause issues with whatever it is that’s causing this issue. This may work, but it’s been a while since I’ve had to use it and I’m not 100% certain that it’s the right cache key wp_cache_delete('get_field_groups', 'acf');