PHP Fatal error: Cannot redeclare distance() when making a new block
It looks like you’re defining distance() in a template file. As @wongjin pointed out in the comments, a template file may be included multiple times, and so on the second inclusion PHP will try to redefine distance(), resulting in a fatal error. Try moving the function distance(){ … } code to a separate file that … Read more