Home Forums General Issues ACF lite + ACF plugin


ACF lite + ACF plugin

  • 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 –

    Is there a workaround to allow ACF to run both as a plugin and as an included part of a theme without conflict?

    • Elliot

    • July 31, 2013 at 2:10 pm

    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

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.