“Fatal error: Cannot redeclare

前端 未结 17 1085
[愿得一人]
[愿得一人] 2020-11-22 05:26

I have a function(this is exactly how it appears, from the top of my file):



        
17条回答
  •  庸人自扰
    2020-11-22 06:13

    This errors says your function is already defined ; which can mean :

    • you have the same function defined in two files
    • or you have the same function defined in two places in the same file
    • or the file in which your function is defined is included two times (so, it seems the function is defined two times)

    To help with the third point, a solution would be to use include_once instead of include when including your functions.php file -- so it cannot be included more than once.

提交回复
热议问题