Question

I'm editing the functions.php file of a WordPress theme and whenever I edit it, even when the edit is adding a single space the server returns

error:

Parse error: syntax error, unexpected '}' in /theme/functions.php on line 1     

This is where I add the single space:

<?php load_theme_textdomain('theme', get_template_directory() . '/languages'); 
 <— I added a single space here

and everything dies after that. This is not a consistent error, as it goes away after I replace the whole functions.php file itself with a backed up one. It only is replicated when I edit the file, that is, as presented even with single white-space character. I'm using NetBeans and CuteFTP to edit then upload the files.

What is going on?! This must have to do with some kind of file quality itself, since from a code standpoint the code is exactly the same...or maybe my server.

Solution:
Netbeans defaults to a specific file encoding per project. Foreign files may have a different encoding which may cause problems. Cody the foreign file's contents to a new blank file which you created via Netbeans.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top