Find answers, ask questions, and connect with our
community around the world.

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

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

    updated 5 days, 19 hours ago 0 Member · 1 Post
  • SharonP

    Member
    September 23, 2022 at 12:58 pm

    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. – by /hq/azhousepro – –

Viewing 1 of 1 replies
Reply to: SharonP
Your information:

Cancel
Original Post
0 of 0 posts June 2018
Now