Forum Moderators: open

Message Too Old, No Replies

Wordpress syntax error

         

geeklike

12:03 pm on Sep 2, 2010 (gmt 0)

10+ Year Member



Hi,

I'm working on a Wordpress page, which has suddenly stopped working. I've been changing a few things in the functions.php-file, and suddenly it started saying this:


Parse error: syntax error, unexpected '}' in functions.php on line 255



Now, I'm not allowed to go to a different page or anything else in the admin-part of the page, nor can I load the page as I normally would.

The part it's complaining about is this:

function twentyten_auto_excerpt_more( $more ) {
return ' …' . twentyten_continue_reading_link();
}


Line 255 is where it says }

When I try deleting just the } or all of it, or comment it out, it still complains about this exact line, and I've checked the code thoroughly many times, and there are the exact same number of {s as }s.

Any help?

Thank you,
geeklike

ergophobe

4:46 pm on Sep 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sometimes this can be caused by a missing quote mark way upstream.

So the parser is seeing nothing but quote until it gets to
return '
which it takes as a *close* quote. Still, in that case, I would expect an "unexpected T_STRING" error.

Any chance of an unmatched quote?

londrum

5:42 pm on Sep 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



maybe you've got a missing normal bracket ')'

if you dont close a normal bracket then it will still think it's inside it, and a curly bracket later on will throw an error

geeklike

6:48 am on Sep 3, 2010 (gmt 0)

10+ Year Member



Thanks, londrum & ergophobe, I was going to try that, but now I can't log into Wordpress at all. Do you you any way short of reinstalling everything that would work?

lorax

12:55 pm on Sep 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Time for std troubleshooting techniques!

Look closely at the line (or code block) immediately preceding the line where the error shows.

Other thoughts to consider, what were you doing right before you got the error?

Have you tried commenting out your edits to or replaced them with the original code?

Did you keep a copy of the original file as a backup? If you did, simply swap them to be sure this one is the culprit (or extract a new copy from the WP download).

ergophobe

7:56 pm on Sep 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>Did you keep a copy of the original file

The WordPress release archive is your best friend:
[wordpress.org...]

A good diff tool - diff, Beyond Compare, Ultracompare - is your second best friend.

Barmolino

1:54 am on Sep 5, 2010 (gmt 0)

10+ Year Member



function twentyten_auto_excerpt_more( $more ) {
return ' …' . twentyten_continue_reading_link();
}
add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
try this one must work fine

geeklike

12:29 pm on Sep 7, 2010 (gmt 0)

10+ Year Member



Thanks everybody, it's working now (: