homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Content Management
Forum Library, Charter, Moderators: ergophobe

Content Management Forum

Wordpress syntax error

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


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,



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

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)

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)

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)

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)

>>Did you keep a copy of the original file

The WordPress release archive is your best friend:

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)

Thanks everybody, it's working now (:

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Content Management
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved