Using wp-load.php to run code outside of WP is throwing an error. functions.php getting called twice?

I don’t know if this should be here or in ProWordPress, but I am trying here first.

In the past, I have been able to run small bits of PHP code outside of WP by loading wp-load.php before the code.

For some reason, when I try it now, I get a critical error saying that I can redeclare a function in my functions.php file, because it was already declared in that same functions.php file.

Fatal error: Cannot redeclare Money_Leaderboard() (previously declared in /var/www/vhosts/domainname.com/httpdocs/wp-content/themes/the-league/functions.php:65) in /var/www/vhosts/domainname.com/httpdocs/wp-content/themes/the-league/functions.php on line 65

This would lead me to believe that somehow functions.php is being called twice. How would that happen? Does this make sense as the reason for this error?

The site works just fine. I only get this error when trying to load wp-load.php.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Your Advertisement Here