• ralph23

    (@ralph23)


    Alright, I’ve just began offering my free wordpress theme for download, the demo site is here:
    https://forthelose.org/themes/rocksolid

    Now, I’ve noticed that 1 out of 10 times (for me), if I upload the entire theme via ftp and activate it, I’ll get an error along the lines of:

    Parse error on line 62 of functions.php, unexpected "}"

    When I go to view functions.php, I see that once it hits line 62, the entire code is shoved onto one line and its unreadable. The only fix I’ve come across is to upload functions.php manually (and not via ftp).

    Is there something wrong with my file? Only one of the downloaders of my theme have reported the same problem (out of the current 250+).

    Here’s the functions.php file:
    https://www.savefile.com/files/2025086

    ANY help appreciated!
    (Has anyone else come across this bug?)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter ralph23

    (@ralph23)

    bump

    Thread Starter ralph23

    (@ralph23)

    bump

    iridiax

    (@iridiax)

    I downloaded and looked at your functions.php with a code editor, and I found bad formatting characters (rendered as boxes) at the beginning of many lines. The text editor you used to create the functions.php or the text editor you copy and pasted from caused this. The code looks like this (with paired brackets since the bad boxes won’t show here):

    []if ( function_exists(‘register_sidebar’) )

    Thread Starter ralph23

    (@ralph23)

    Hm… thats odd. I just downloaded the same file and opened it in Notepad++ (the text editor I use) as well as plain old Notepad and I didn’t see those boxes.

    What did you open the file in?

    Thanks for helping, btw.

    iridiax

    (@iridiax)

    I just downloaded the same file and opened it in Notepad++ (the text editor I use) as well as plain old Notepad and I didn’t see those boxes.

    The text editor adding the normally invisible control/format characters won’t show them. You may have to adjust your line break settings.

    What did you open the file in?

    I use BBEdit (for Mac only), which handles Unix, Windows, and Mac text. BBEdit has the option to strip text gremlins (control characters, line feeds, and null and non-ASCII characters), and I’ve had to use this option more than once when copying code from the web or from another application.

    iridiax

    (@iridiax)

    I just tested it, and your box characters are actually control characters.

    Thread Starter ralph23

    (@ralph23)

    Oh I see.

    After googling around a bit, I can’t seem to find an answer as to how to remove them. Any tips? (thanks again)

    iridiax

    (@iridiax)

    It’s probably a setting/option in Notepad++. If not, you could try a different text/code editor. I’m sure that there are free ones available for Windows.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Functions.php Become Corrupted?’ is closed to new replies.