Support

Account

Home Forums General Issues Child and Parent Theme calling acf.php error

Solved

Child and Parent Theme calling acf.php error

  • I am working with a child theme of a premium theme that uses ACF in lite mode.
    I need to add additional custom fields to a certain post type.
    I’ve followed the documentation and can get the custom fields to work. but it removes certain content from the theme.

    It looks like the theme is already calling acf.php in another area, and by calling it twice there is some funky business going on.

    Once i delete my call to acf.php in the child theme functions the custom fields go away.

    Any other way to skin this cat and get both the developers fields initiallyintended with the theme, and also my new fields?

    thanks.

    Craig

  • Hi @info@orgspring.com

    Sounds like all you need to do is check if acf.php has already been included.

    Something like this should work:

    
    <?php 
    
    if( !class_exists('acf') )
    {
    	include_once('...');
    }
    
    ?>
    
  • Nah, still not working. Same issue still exists. Advanced fields for my taxonomy not showing up.

    Even if I pull out the call to the custom post type and taxonomy file and place all that code inside the child theme functions.php it doesn’t work.

    This is really frustrating because it works both ways, just not at the same time.

    Theme developer is on vacation too, and not offering support for some time.

    I’m not sure what I need to be calling or if I need to include acf.php in a different way.

  • any attempt to include acf.php in my child makes my fields workk, but eliminates the theme authors fields.

    If i leave that code out, his fields work, but not mine.

    Not sure where to go with this one.

  • Hi @info@orgspring.com

    I’m not sure either, seems like you need to dig into the code and find out exactly what’s going on instead of applying band-aids.

    Cheers
    E

  • As in debugging your child and parent theme to find out when and why ACF is and isn’t loaded

  • Good timing. I just started with a clean copy of the theme and child to see if I can recreate it. We’ll see where it goes.
    Thanks.

  • Got it working beautifully on a clean theme and child theme, even in a plugin.

    But Couldn’t get it to work on this one particular premium theme. Can’t figure it out at all.

    I do know that theme author is using an older version of your code though.
    I tried replacing his code with the new acf, and that blew it out too.

    My guess is that his code is relying on your older code.

    Either way, I think I’m going to take this up fruther with theme developer. Only problem is he’s not very responsive. Poor form.

    Anyway, thanks for your help on this. Gonna bring this one to a close.
    Pull my hair out one last time and then move on.

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

The topic ‘Child and Parent Theme calling acf.php error’ is closed to new replies.