First question on Stack.
I made a wordpress theme for a school project and I have a problem that I can't resolve alone.
I made a theme that needs ACF (there are some call get_field() and the_field() inside. But when I activate my theme I got some errors if acf is not enable. So I decide to find a solution and made a condition inside my functions.php
if (!function_exists('get_field')) {
function get_field()
{
return;
}
}
if (!function_exists('the_field')) {
function the_field()
{
return;
}
}
So I add http://tgmpluginactivation.com/ inside my theme too to tell users that ACF is required with the possibility to install from my theme.
All is right for installation but when I want to activate the plugin :
Fatal error: Cannot redeclare get_field() (previously declared....)
I know that I previously declared get_field() and the_field() in my functions. But now, is it possible to erase my previous declaration with new ACF functions ?
I check before on stack board but I didn't find anything :(
Thanks a lot !