A problem with functions.php file on my WordPress site

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.

Topic themes Wordpress

Category Web


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.


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.