Troubleshoot & Fix Theme Errors
Knowing Common WordPress Issues & Knowing How to Get Thru Them Intuitively Is The Art
By The Hitchhiker
Troubleshoot and fix theme errors in WordPress
From time to time, a WordPress theme can cause an error or issue with your site. The issues may appear as a fatal, syntax, or sidebar error, a white screen, or a missing style sheet, among others. You have two options when troubleshooting and fixing theme errors on your site:
- Reach out to me & I can do it for you for a fee.
- Do it yourself following the instructions in the tables below.
WEBSITE TECH SUPPORT
Nerd of Fortune can perform the following Theme related services for you for a fee:
- Diagnose and fix ANY theme issue.
- Reinstall the active theme.
- Create Custom Theme
Do it yourself
To diagnose and troubleshoot a WordPress theme, complete the following:
| Process | Difficulty |
|---|---|
| Troubleshoot theme errors in WordPress | Medium |
| Setup PHP error logging | Medium |
| Fix theme errors in WordPress | Medium |
| Check cross browser compatibility for WordPress | Medium |
Troubleshoot Theme Errors in WordPress
Troubleshoot theme errors in WordPress
WordPress theme errors can result in error messages or blank white pages, which is commonly referred to as a white screen of death. You can use the steps below to diagnose potential WordPress theme errors.
Prepare your WordPress site for troubleshooting:
- You should always backup your site before performing any troubleshooting.
- Disable all plugins, especially any caching plugins.
- If your site uses wp_cache, you will need to disable WP_CACHE.
Look for a theme related error
- Enable WordPress debug mode.
- Visit your site and check to see if there is a PHP error.
- If there is a PHP error, check to see if the themes directory is in the file path. Below is an example:
Fatal error: Call to undefined function functionName() in /home/wp-content/themes/twentyeleven/functions.php on line 1
- If the file path contains themes, then this confirms the issue is with the theme, and you can move on to fixing the error.
- If the error is not visible on your website, then you will need to expose the error:
- Linux Error Logs (cPanel / Web Hosting)
- Windows Detailed Errors (Plesk / Web Hosting)
- If the detailed errors or logs show a PHP error, then you can begin fixing it.
Determine if the error only occurs with your currently active theme
- Connect to your hosting with FTP to upload files.
- Navigate to the directory containing your WordPress site.
- Then open the wp-content/themes directory.
- Make note of the latest default theme that is installed.
Note: Default WordPress themes are named after the year they were released. For instance, the default theme that came out in 2017 is named twentyseventeen.
- Update your WordPress site to use a default theme in the database.
- Check your site. If the issue is no longer persisting, then you have successfully determined the issue is with your non-default theme.
Next steps
- After confirming the problem is related to your WordPress theme, you can move on to fixing the problem.
More Info:
Setup PHP error logging
PHP error logging
When troubleshooting PHP errors, you will want to review your PHP logs. If you don’t have PHP logs to review, use the following process to set up logging:
Note: For WordPress and Managed WordPress error logging please see Enable debugging to display errors in WordPress.
- You should always backup your site before making any changes to your site.
- Locate your PHP initialization file.
- Edit the file. (cPanel / Plesk / VPS)
- Place the following line in your initialization file:
error_log = /path/to/your/webroot/php_error.log
- Create the a file named php_error.log in the in the webroot of your hosting.
- Restart your PHP processes.(cPanel / Plesk).
Fix theme errors in WordPress
Fix theme errors
After troubleshooting your site to determine the error, you can attempt to fix your theme and return your site to a working state.
Understanding a WordPress related PHP error
If your previous troubleshooting revealed a PHP error, use the following table to help understand the error.
| Error type | Definition and Next Steps |
|---|---|
| E_ERROR | This is a fatal error that causes script termination. These typically are caused by calling a non-existing object like a class or function. This can often occur in version incompatibility. Your next steps should be to update your WordPress version, themes, and plugins. |
| E_WARNING | A run-time warning does not cause script termination. These are potential issues that occur but do not stop the processing of PHP. These can often include deprecation warnings, which indicates that your code may be using an outdated version of PHP and needs to be updated. A warning in your PHP logs may not necessarily be related to the issue you are experiencing. |
| E_PARSE | This is a compile time parse error. It is usually indicative of a PHP syntax error, such as a missing semicolon ;, parenthesis (), or opening or closing bracket {}, or any number of other syntax errors. You should review the file and line specified in the error message and look for potential syntax error. |
| E_NOTICE | These are typically PHP errors that don’t cause script termination. They indicate that there could be an issue, but may be part of the normal running of the script. A common cause is using a PHP variable that is undefined. A notice in your PHP logs may not necessarily be related to the issue you are experiencing. |
Update your WordPress components
When your WordPress version, theme, or plugins are updated, they may develop a conflict with the other components that have not been updated. Updating the other components can restore your site. See the following to update a component of your site:
- WordPress core
- Theme
- Plugins
- PHP version (cPanel / Plesk / Web Hosting)
White screen with no PHP error
If you have a white screen of death, and your troubleshooting did not reveal a PHP error, then check the following:
- Make sure your wp-content/themes directory is present.
- Confirm the permissions are correct for the wp-content and themes directories.
- 755 for Linux accounts (cPanel / Web Hosting)
- Read and Write for Windows accounts (Plesk / Web Hosting)
- Confirm the directory for your active theme also has the correct permissions.
- Make sure the directory for your active theme has files present in it.
- Check to see if there is a default theme also present in the wp-content/themes directory. WordPress will automatically load the default theme in the event the active theme is not present.
- Confirm the index.php file in the root directory is not missing or blank.
- Confirm your theme’s index.php file is not missing or blank.
Check cross browser compatibility for WordPress
Check cross browser compatibility for WordPress
Cross browser compatibility issues in WordPress are typically CSS related. You will often notice this issue when browsing your site and certain elements aren’t in the right place, do not appear to resolve properly, or simply don’t load at all.
Older WordPress websites could run into issues with cross browser compatibility. Due to strict plugin and theme requirements you are less likely to find any current plugins or themes with this issue.
The Microsoft Edge browser will easily help you run cross browser compatibility checks on your site.
- Open the Edge browser.
- Use the browser to navigate to your website.
- Press the F12 key to load the Developer Tools.
- In the window that pops up, click on the Emulation tab.
- Under User agent string, select the version of browser you want to test.
Note: A great place to start is IE 8, since is this an outdated browser that is still commonly used.
- Review your site and note any inconsistencies.
- Repeat steps 5 and 6 as needed with the browsers you suspect have issues.
Since WordPress itself is already optimized for cross browser compatibility, your list of inconsistencies should point to a theme or plugin that is causing the issue.





