How to use ACF Field in Functions.php in the theme?
When I install the theme then I see an error on the screen.
call to undefine function get_field()
Please tell me how can I solve this error. π€·ββοΈπ€·ββοΈπ€·ββοΈ
Do you have ACF or ACF Pro installed?
No. IF I install the theme then I see this error.
I solve this error using this code
if(function_exists("get_field"){
// code
}
Thanks for replying me ππ
yes its because you need to install ACF in order to use the function get_field()
i would recommend doing it because i think your theme depends on it
Yes, my theme depends on ACF. I also have added ACF Plugin to theme plugins.
When the user installs my theme he gets notification for Required Plugins.