Welcome to WebmasterWorld Guest from 23.22.140.143

Forum Moderators: ergophobe

Message Too Old, No Replies

Wordpress syntax error

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

New User

5+ Year Member

joined:Mar 19, 2009
posts: 37
votes: 0


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 Sept 2, 2010 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8137
votes: 99


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 Sept 2, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2006
posts:2493
votes: 22


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 Sept 3, 2010 (gmt 0)

New User

5+ Year Member

joined:Mar 19, 2009
posts:37
votes: 0


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 Sept 3, 2010 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7575
votes: 0


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 Sept 4, 2010 (gmt 0)

Moderator This Forum

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts: 8137
votes: 99


>>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 Sept 5, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 5, 2010
posts: 1
votes: 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 Sept 7, 2010 (gmt 0)

New User

5+ Year Member

joined:Mar 19, 2009
posts:37
votes: 0


Thanks everybody, it's working now (: