When I add functions.php file to my WordPress website, my website just stops working.

It doesn't matter if I have or have not code there, whenever the functions.php file is present, the site stops working. I tried to check if there is any typo or parser error, but I can't find nothing nor the debugger doesn't report anything. This happens also when I follow tutorial in a book.

  • Switch to a default theme that ships with WP and turn off all plugins. Try it there, report back (in an edit to the question) if the problem persists. – kaiser Feb 3 '17 at 13:04
  • Impossible to answer without debug information. And yes, there must be some error in the logs. – fuxia Feb 3 '17 at 13:19
  • Wellcome aboard @Coder. We need coders like you. – prosti Feb 3 '17 at 14:06

You need to enable your debug log to know actual problem on your site.

Enable Debug log from your site though below steps:

  1. Open wp-config.php from your WordPress setup.
  2. Add below lines

    define( 'WP_DEBUG', true );

    define( 'WP_DEBUG_LOG', true );

    define( 'WP_DEBUG_DISPLAY', true );

And just refresh the page.

Now you can see the error message's and warnings behind your problem.

For more information @see https://codex.wordpress.org/Debugging_in_WordPress

So, You know the actual reason of why functions.php not working on your site.

  • Very solid answer @maheshwaghmare – prosti Feb 3 '17 at 20:28

I'm quite new to WordPress and I have a problem. I don't know how many of you has the same problem, but always when I add functions.php file to my WordPress website, my website just stops working.

You are maybe overwriting the existing function.php file when you add functions.php to your site.

You should just edit your functions.php file that exists insite your theme.

Many new Wordpress coders did that and this is OK, while you are the novice. Wellcome aboard to WordPress and to this website.

  • @Coder It's difficult to know what's the reason behind this. – maheshwaghmare Feb 3 '17 at 17:23
  • @maheshwaghmare, yes bro, the part of the question was he is the very new in WordPress, and just followed some tutorial, and chances are he overwrote the file. – prosti Feb 3 '17 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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