Editing the core files is not recommended. You may try downloading a clean install of WordPress files. If you can, set the current theme to TwentySeventeen so your database is ready to work with a clean install.
Make sure to back up your database if you have not already.
Follow the codex instructions to delete the old WordPress files. They have a nice list of all the files you want to keep for the clean install. Although, rather than deleting, I recommend changing the directory name to something like wordpress-backup
and then installing the new files with the original directory name wordpress
or whatever it’s currently called.
Then you can start copying over the essential files. Be sure to do this before trying to run the site again. Especially if you could not switch to the TwentySeventeen theme first. You will want to make sure the theme you’re currently using will be found. Here are the files to copy to the clean install:
-
wp-config.php file;
-
wp-content folder;
-
wp-includes/languages/ folder–if you are using a language file, and
it is here rather than in wp-content/languages/, do not delete this
folder (you might want to move your language files
to wp-content/languages/ for easier upgrading in the future); -
.htaccess file–if you have added custom rules to your .htaccess, do
not delete it. -
Custom Content (themes) and/or Plugins–if you have any images or other custom
content or Plugins inside the wp-content folder, do NOT delete them.
Now test the site and try changing the theme to TwentySeventeen theme if you couldn’t do that before. It’s always best to test the defaults first to rule out an incompatible theme or plugin as you did earlier.