Avoid the Unexpected T_String Parse Error When Activating a Theme in WordPress

I post this only because it is a common issue that comes up when installing a WordPress theme. The issue is when you upload the theme folder via FTP. At some point, extra white spaces can end up in the PHP files and the following error or something similar  is thrown:

Parse error: syntax error, unexpected T_STRING in /home/xxx/public_html/wp-content/themes/StandardTheme_270/admin/functions.php on line 1

It can happen with any theme package or plugin and as you can see that one came from somebody using the Standard Theme.

There are multiple ways around this. You could upload in binary, upload the zip file and extract it on the web server through SSH or the easiest method is to use the built in features of WordPress. For a plugin, you can install the plugin through the WordPress admin and for a theme you can install the theme through the WordPress admin as well if your WordPress version supports it. Both methods unzip the file and don’t corrupt the files. 

Wow. It's Quiet Here...

Be the first to start the conversation!

Leave a Reply:

Gravatar Image

CommentLuv badge

This site uses KeywordLuv. Enter Your Name@Your Keywords in the Name field to take advantage.

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Have you Subscribed via RSS yet? Don't miss a post!