I understand that lite is now just an option to hide ACF, however if I am including it in a theme that someone may download I assume they may want to use ACF as a plugin. In this case the plugin becomes redundant.
I did a test locally and can see that I cannot activate ACF when ACF lite is included. Error – http://grab.by/oTYe
Is there a workaround to allow ACF to run both as a plugin and as an included part of a theme without conflict?
Hi @SmashBrando
To include ACF as a theme feature, you can use the following code:
define( 'ACF_LITE' , true );
include_once('advanced-custom-fields/acf.php' );
Becuase plugins are run before the functions.php file, you could first check for the ACF plugin like so:
if( ! class_exists('Acf') )
{
define( 'ACF_LITE' , true );
include_once('advanced-custom-fields/acf.php' );
}
Hope that helps