Check from functions.php if function exists in footer.php
You should not declare functions in your templates. The templates are for outputting content. The function_exists() will check if the function is declared before the function_exists() call, not after it, and templates are loaded after functions.php file, since you can control them by using the template_redirect filter. Declare your function in your theme’s functions.php file, … Read more