WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Theme error on localhost (5 posts)

  1. geoffkb
    Member
    Posted 7 months ago #

    I'm working on a company site which has a custom theme which my predecessor wrote. It seems to work fine online, but when I try to use it locally I get this error "Parse error: syntax error, unexpected end of file in C:\xampp2\htdocs\f******r\wp-content\themes\f*****r\functions.php on line 46"

    If I change to another theme locally it works fine. I don't have time to learn php right now. Is there any way I can easily find and fix the errors in the the custom theme, if that's what's causing the issue?

    I wonder if it might be related to the WordPress version. I'm using WordPress v3.8.1 locally, version 3.6 online. I'm scared to update the online WordPress version in case it screws up their site.

    I could create the new pages online and not publish them until they're approved, but I'd rather do it offline, especially since I'm trying to impress them. Bringing down their site won't get me any brownie point.

    Any suggestion would be much appreciated.

  2. esmi
    Forum Moderator
    Posted 7 months ago #

    There's no easy way to locate the code that is causing the problem with these kinds of errors. You're going to have to look through the whole file to try and find out where a conditional loop wasn't closed.

    And, no, it has nothing to do with the WordPress version. It's a straight forward coding error.

  3. zebrawebdesigns
    Member
    Posted 7 months ago #

    Hello geoffkb

    Check whether the code uses <?php or <?

    If it is <? then you might need to enable short open tags in your local setup. It is advisable to replace <? to <?php

  4. geoffkb
    Member
    Posted 7 months ago #

    OMG! Thanks for the responses, that fixed it.

    I replaced <? with <?php (thank you Dreamweaver) and of course it went to the next error which was in another file. I fixed that and then the next, and voila!

    It took two passes to find and replace all intances because if you just do a straight replace you can't differentiate between "<?" and "<?php" so I ended up with "<?php php" the second pass replaced "<?php php" with "<?php".

    Thank you SO much for your help!

  5. zebrawebdesigns
    Member
    Posted 7 months ago #

    You are welcome

Reply

You must log in to post.

About this Topic