How to call custom function from functions.php in site-wide template files?
It’s worth noting that PHP namespace issues can contribute to this problem. This can catch people because namespaces have been kept out of WordPress core codebase until recently. For example one of your code files may have a Namespace declaration around the top. If that is the case you will have to prefix any references … Read more