title: Including ACF (Advanced custom fields) in a custom theme or plugin: Exporting fields on distribution
body: <p>I am working on a custom theme and have included acf pro inside that theme as mentioned in the <a href="https://www.advancedcustomfields.com/resources/including-acf-in-a-plugin-theme/" rel="nofollow noreferrer">docs</a>. The theme is working fine and acf is activated on theme activation. Here is the code.</p>
  
  <pre><code>// customize ACF path
  add_filter('acf/settings/path', 'my_acf_settings_path');
  function my_acf_settings_path( $path ) {
      $path = get_stylesheet_directory() . '/inc/advanced-custom-fields-pro/';
      return $path;
  }
  // customize ACF dir
  add_filter('acf/settings/dir', 'my_acf_settings_dir');
  function my_acf_settings_dir( $dir ) {
      $dir = get_stylesheet_directory_uri() . '/inc/advanced-custom-fields-pro/';
      return $dir;
  }
  // Include ACF
  include_once( get_stylesheet_directory() . '/inc/advanced-custom-fields-pro/acf.php' );
  </code></pre>
  
  <p>The issue i am facing for couple of hours now is due to the groups/fields that i want to be instantiated inside acf. I have some field groups that i want to be shown on fresh installation. Below are the methods i have tried:</p>
  
  <p><strong>Method 1:</strong>
  I have exported the fields as json inside a folder called <code>acf-json</code>. ACF does recognize it and shows as a sync field. But when i try syncing it, it just creates a new empty field.</p>
  
  <p><strong>Method 2:</strong>
  I have also tried exporting the field groups as php files and then including it in my functions.php file but acf doesn't recognize this code.</p>