(See comments by others for your PHP error – though I’d recommend a good editor or IDE to help you spot syntax errors quickly and tidy the code for you as you type.)
Re: the question title, no, you usually don’t have to do a clean install if there is an error with a theme and you find yourself locked out of the main site and /wp-admin
.
There’s a simple way to reset to the default WordPress theme (e.g. Twenty Fifteen
).
- In (S)FTP etc., rename the theme directory from
Divi
toDivi-temp
- You should now be able to access
/wp-admin
again - You’ll see this message: “The active theme is broken. Reverting to the default theme.”
- Now fix your theme / restore a working copy from a backup and re-enable it.