Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Can I mess up my Wordpress site if I change functions.php file for my custom theme?

One time I added some code to it and it gave me some PHP errors and my site was inaccessible. Luckily it was in the early stage of the website so I just reinstalled Wordpress.

So, my actual question is - does functions.php file have any influence on any other file or database or any other part of the website? If I have a back up of the functions.php file, can I just replace the screwed up file via FTP or do I have to do something else?

The same questions goes for .htaccess file - if I add this code:

php_flag register_globals off

to it, can I change something irreversibly or do I just upload the back up and all goes back to normal?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

functions.php file is where you can do wonders with your theme without touching the core WordPress files. Most of the time the backup functions.php trick would work for you unless you aren't changing anything in the database with any of your action or filter hooks. You could check this link too -> http://codex.wordpress.org/Theme_Development#Functions_File

Regarding the .htaccess - you should be fine by just replacing the backup file. Nothing irreversible done here.

share|improve this answer
add comment

Yes, backup copies of files should provide you the security to get adventurous on both counts. The functions.php file in your theme should be the very place where you try to experiment with WordPress. As a general rule of thumb, it is bad form to tamper with core WordPress files elsewhere. But the functions.php file in your theme give you complete liberty to modify any of WordPress's default functionality. This also keeps your theme changes in tack when it comes time to upgrade to latest version of WordPress.

If you break it or add bad code to it, just go back a step or replace it with an empty copy of the same and you should be back up and running in short order.

share|improve this answer
    
OK, great. I remember that after I made changes to functions.php file, an error was about a code in some core file. Thanks for your reply. –  John Doe Dec 10 '11 at 11:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.