jondueck
Member
Posted 4 months ago #
Today, while updating my functions.php file, I was commenting out a function I was planning to eliminate. I missed the closing } tag, and saving the file brought down the site.
Since then, I have tried using FTP to upload a corrected functions.php file. When that too failed, I uploaded the original functions.php that came with the theme. Also unsuccessful.
Here is the error:
Warning: require_once(TEMPLATEPATH/lib/init.php) [function.require-once]: failed to open stream: No such file or directory in /home/jonathan/public_html/strongerufitness.com/wp-includes/functions.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'TEMPLATEPATH/lib/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jonathan/public_html/strongerufitness.com/wp-includes/functions.php on line 3
Help? Thanks.
According to the magic of Google Cache, you were using this theme:
http://www.studiopress.com/themes/goinggreen
You were editing wp-content/themes/goinggreen/functions.php?
Can you get a fresh copy of that theme, use FTP to rename the old goinggreen directory, and re-upload a fresh copy?
jondueck
Member
Posted 4 months ago #
The theme is indeed "Going Green" - but I'll have to take your word on the exact path you specified. The functions,php file I've been updating is inside the wp-includes folder.
That may be the problem... But to answer your question, using a fresh copy of functions.php to overwrite the bad one via FTP was not successful.
Any other ideas?
jondueck
Member
Posted 4 months ago #
I found the functions.php file you posted the path to. Upon viewing it, I can see it's the one I meant to overwrite. However, overwriting it does not repair the site. I get the same error message and white screen.
The functions,php file I've been updating is inside the wp-includes folder.
That's not good, but fixable. You are running 3.3.1 so download the WordPress zip file and extract wp-includes/functions.php and FTP that to your server. You want to overwrite the bad copy you have there.
http://wordpress.org/latest.zip
As you've found out, don't ever modify WordPress core files. It's just not worth it and when an update comes out you'll be sorry.
In your case, you're an early adopter: you're already sorry. ;)
Replacing that file should fix it for you.
jondueck
Member
Posted 4 months ago #
UPDATE... I've been updating the wrong functions file all along. Now the THEME functions.php is fixed. However, the functions.php file in wp-includes is now full of the theme's functions.
Is fixing this just as simple as locating an original functions.php from wp-includes, and FTP'ing it into place? Can i just lift copy one from another wp installation?
Thanks.
jondueck
Member
Posted 4 months ago #
Jan, our paths crossed. Thank you for your response. :)
jondueck
Member
Posted 4 months ago #