CMS & WordPress
okay well for this kind of error I usually go to the mentioned line and fix it however this time there is nothing to fix so I have no clue what the problem is
Using latest version of wordpress 3.4.1, created a new theme, the css has the styles, the index.php is an empty file, I did it like that to make sure it is not causing problems, header.php and footer.php are with content but not calling them from anywhere at the moment so I have an index page that has opening and closing php tags with the template details as comment then I have a functions.php file and here is where I get the error
Parse error: syntax error, unexpected T_VARIABLE in /public_html/wp-content/themes/newtheme/functions.php on line 1
okay so I had functions in it all setup to run the theme and got the error so I decided to empty it and the error is gone, so I started adding things and no matter what I add I get the error on line 1 for example if the file looks like this
$somevar = 'test';
I get that same error, I made sure there are no spaces after the closing tag so, the only way the template works is if the functions.php only has opening and closing php tags and no content on it, or completely empty and at this point I really have no clue how to fix this problem
okay so I was thinking that maybe there was a plugin in the site affecting the theme so what I did is added all the functions.php content to the index.php and that way the site loads just fine, the problem is only when the functions.php has content in it
okay so I found the problem, don't know where it is though, but basically I just added ";" to the beginning of the functions.php and the problem is gone but right now I have all my theme's php files completely empty except for the functions.php which now has this
and that let's the site load properly, well a blank page but at least no errors so I guess I have to start disabling plugins until I find the one causing the problem!
This topic is now archived. It is frozen and cannot be changed in any way.