SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict tlacaelelrl's Avatar
    Join Date
    Apr 2011
    Location
    Mexico city, Mexico
    Posts
    353
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    wordpress functions.php problem, unexpected tstring or unexpected end

    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

    Code PHP:
    <?php
    $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
    Do you get bothered because I do the same thing every day?
    Do you question why I do it?
    Then find something that you actually like doing!!!

    Stop thinking on what I do.

  2. #2
    SitePoint Addict tlacaelelrl's Avatar
    Join Date
    Apr 2011
    Location
    Mexico city, Mexico
    Posts
    353
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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
    Do you get bothered because I do the same thing every day?
    Do you question why I do it?
    Then find something that you actually like doing!!!

    Stop thinking on what I do.

  3. #3
    SitePoint Addict tlacaelelrl's Avatar
    Join Date
    Apr 2011
    Location
    Mexico city, Mexico
    Posts
    353
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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

    <?php
    ;
    ?>

    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!
    Do you get bothered because I do the same thing every day?
    Do you question why I do it?
    Then find something that you actually like doing!!!

    Stop thinking on what I do.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •