WordPress is the favorite blogging platform and content management system for millions of people, but there are still those webmasters who give up on WordPress due to having difficulties with activating certain WordPress themes, and plugins. It's not uncommon to see themes produce errors and issues that can be hard to deal with. The WordPress official support forums are always full of bloggers looking for help with something related to the inner workings of WordPress.
Today, we're going to take a look at some of the most common errors that bloggers are experiencing, and also we will take a look at the solutions of overcoming these errors. WordPress is great because it's so simple to use and understand, but it's totally understandable when people without prior experience need some help.
WordPress Syntax Errors
Parse error: syntax error, unexpected $syntax in /var/www/blog/wp-content/themes/site/functions.php on line 1337
The syntax error is quite easy to deal with, it usually occurs when you're trying to use either an older version of a theme, or you've tried to modify the code of your theme – which ultimately led to the error. Now, you've got several options to deal with this:
- Reassure yourself that all the code within the modified file is in accordance to the languages standards, so debug your code or reupload the original theme files.
- Look up the error code on WordPress support forums, or Google – then use this information to adjust the necessary changes and fix the code.
- If you are using a premium WordPress theme, you could consider asking the theme developer for help, in case you still have theme support included.
- If the problem continues to persist, consider using a different theme.
Syntax errors are generally very easy to deal with, it also gives you nice experience in code editing once you fix and/or deal with it. When you have a syntax error on your site, it just means that the code is not written properly.
Sidebar Out of Context
If you've just installed a new WordPress theme and happen to experience an error of having the sidebar not displaying correctly, don't worry – as it is usually very easy to fix. This problem can usually be redirected back to the theme creator, as it involves changing/closing up some of the HTML elements. Always Google the theme name of your WordPress theme to see what others are doing to fix the problem or contact the theme developer.
- Skim through the sidebar files in your theme directory, look for any left open HTML tags that need to be closed, any modern code editor will show you how to do it.
- You can also try playing with the dimensions within your themes stylesheet. Usually there are two content areas, the main content area and sidebar area, both of which have their own dimensions allocated. So, if total width of the page is 1000px, then having 700px content area and 400px sidebar area is not going to work. Adjust as necessary!
- If you've a problem with your sidebar after you have modified the code of your WordPress theme, there is a pretty good chance that the problem is caused by your code. So you should debug your code and fix accordingly.
- Sometimes it can also happen that problems with your sidebar are caused by plugins. If you experience that a plugin is breaking your HTML markup, you could replace the plugin with another plugin which is working fine or ask the plugin developer for a fix.
Cannot Modify Header Information
Warning: Cannot modify header information - Header already sent by (Output started at /var/www/blog/wp-content/themes/demo/functions.php:15)
Right, header already sent error is quite easy to fix. What it means is that somewhere in the given file there is an extra 'empty' space added that is causing errors. It's super easy to fix.
- Open the broken file. (in our case: functions.php)
- Remove all spaces before and after the tags! (important!)
- Save the file and re-upload to WordPress.
- Working now!
Broken WordPress Homepage
The tricky part about WordPress themes is that you never really know what your site is going to look like, until you actually download, install and activate the theme you've chosen. Sometimes, once you do, the homepage doesn't really look like expected. How do we fix this?
Typically, what happens is that the WordPress template gets all messed up. You can navigate back to “Settings => Reading”, and change the settings to show the latest blog posts on your front-page, rather than a pre-determined static template. As for vice versa, just use the included templates to create a new homepage. Most of the WordPress themes out there require an initial setup to reproduce the layout you might have seen in the theme demo. In that case you should check the theme documentation and follow the instructions.
How to Change Permalinks
It's not really a theme issue, but we've seen people struggle with this so much, and quite a few assume that permalinks come integrated within a WordPress theme. Nope, they're a separate global setting in WordPress. Head over to “Settings => Permalinks” to adjust! You can use any of the pre-defined URL styles, or you can build your own.
Missing Featured Image Thumbnails for All Posts
This one's so annoying, because it makes you think that you're going to lose out on a theme you've just installed, supposedly because it doesn't support featured images? Luckily, there are developers out there who have built plugins to help us deal with this problem. The Easy Add Thumbnail plugin for example checks if you defined the featured image (also named post thumbnail), and if not it sets the featured image to the first uploaded image into that post. That easy!
Common WordPress Theme Errors and How To Fix Them
We are pretty sure that you also have experienced other common WordPress theme errors before. You can check our support center where we have collected more WordPress tutorials and also a lot of information regarding the setup and installation of WordPress themes by MH Themes. We'd love to hear user input on this as it helps to maintain the content evergreen for those who're just starting out with WordPress, and blogging as a whole.