Welcome to WebmasterWorld Guest from 54.147.212.98

Forum Moderators: ergophobe

Message Too Old, No Replies

Wordpress syntax error

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

5+ 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
4:46 pm on Sep 2, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 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?
5:42 pm on Sep 2, 2010 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



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
6:48 am on Sep 3, 2010 (gmt 0)

5+ 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?
12:55 pm on Sep 3, 2010 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 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).
7:56 pm on Sep 4, 2010 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 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.
1:54 am on Sep 5, 2010 (gmt 0)



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
12:29 pm on Sep 7, 2010 (gmt 0)

5+ Year Member



Thanks everybody, it's working now (: