I have a website: www.convert2latex.com . While trying to remove the "continue reading", I accidentally deleted some code and updated it in the theme editor's functions.php. Now the website does not work and here is the error code

Parse error: syntax error, unexpected '}' in /home2/efulas/public_html/wp-content/themes/catch-box/functions.php on line 395

How can I fix this?

  • despite the fact that you deleted some code, the error is regarding the fact that there is a syntax error. there is a '}' that you need to remove, at least. – Masiorama Feb 4 '15 at 11:29
  • As far as I am concerned, there is no line numbering in WordPress. Therefore, I could not fine it. Is there any way I can undo it? – Günal Feb 4 '15 at 11:32
  • retrieve the source code of the theme and then restore it. nothing more. for the future I suggest a code versioning system. – Masiorama Feb 4 '15 at 11:33
  • That is what I thought, but could not find the source code. Any suggestion how to get it? – Günal Feb 4 '15 at 11:34
  • 2
    Never use the back end editor. Because it does not have a syntax highligher and because we are human, you are bound to forget and overlook one tiny syntax, and you will break your site. Only thing now, log into ftp and correct the broken syntax. You can also try to change the active theme in the db to one of the bundled themes. If I can give you one tip, get yourself a local test site with a proper syntax highligher and code editor and test all code off line, and as I said, never use the back end editor – Pieter Goosen Feb 4 '15 at 11:42

You can replace the broken functions.php file, recovering it from the original theme package.

From the namespace of your error message I can guess that the theme you are using could be this:


Right? I hope it helps.

  • yes that is my theme. However, I cannot reach my admin page anymore. What should I do? – Günal Feb 4 '15 at 11:45
  • From production environment? Can you access via ftp and replace the broken functions.php? This should do the trick, simply as that. – Masiorama Feb 4 '15 at 11:47
  • I am new to web designing. Can you please describe how to do that? – Günal Feb 4 '15 at 11:48
  • Ehm, that has nothing to do with webdesign... your hosting provider should have sent you some configuration credentials to connect via FTP to send files on the server... anyway, this is too broad, you should contact a developer, there are too many things to know if you are a novice. – Masiorama Feb 4 '15 at 11:52
  • @Günal you don't need a developer. Just contact your hosting provider, they should be able to help you in replacing the defective file with a working one – Pieter Goosen Feb 4 '15 at 11:56

As you error messgae, check your theme functions.php file, line no 395, you may see there have some code like } endif; Just delete those code and I hope your problem will solve.

Not the answer you're looking for? Browse other questions tagged or ask your own question.