2014-04-27

Recently, I found out that there is a huge error log file (error_log) in my current theme folder. Upon checking the whole log file contains the following error.

Upon checking & try to reproduce the error, I find out that the error was generated each time when a visitor tries to access theme’s index.php file directly.

I’m not sure if there will be a security issue, but the error will expose your cPanel username if you are using it.

There are 2 methods on how to fix this problem.

1. Redirect it to main page. To do it, edit “index.php” in the root of theme folder & replace

with

2. Disable direct access of theme’s index file. To do it, edit “index.php” in the root of theme folder & replace

with

The post Fix the “PHP Fatal error: Call to undefined function get_header()” error in WordPress appeared first on Internet Earnings.

Show more