Support

Account

Forum Replies Created

  • If you’re doing a parent theme -> child theme framework.

    You can make your fields and create separate directories for each of the json files in the parent theme.

    
    acf/library/fields.json
    acf/slideshow/fields.json
    acf/accordion/fields.json
    

    In the child themes functions.php you can set custom load directories.

    
    function acf_json_load_paths( $paths ) {
    
      // Loads alls json files from the /acf-json folder in the child theme
      $paths = array(get_template_directory() . '/acf-json');
    
      // If this theme is a child theme it will load all the fields in the acf-json/library directory
     
      if(is_child_theme()) {
        $paths[] = get_stylesheet_directory() . '/acf-json/library';
      }
    
      return $paths;
    
    }
    add_filter('acf/settings/load_json', 'mw_acf_json_load_paths');
    

    Not sure if this the right solution.

Viewing 2 posts - 1 through 2 (of 2 total)