need some urgent help

bimmerime

Regular Member
Joined
May 14, 2015
Messages
282
Reaction score
20
hi
i tried to edit my functions.php file but ended up messing it up. now i can't access my site. i need to switch to the default wordpress theme through my host. how can i do this?
 
don't worry about it. i'm just a noob . i got it fixed
 
Can you share how did you fix it so others (including me) could learn from this ?
 
Can you share how did you fix it so others (including me) could learn from this ?

Through ftp delete function.php or delete the whole theme. Download the last backup of your site from cPanel or whatever you are using, and than replace function.php or the whole theme

However, if you delete function.php or the whole theme you can access your site as admin at yoursite(dot)com/wp-admin and than change the theme
 
Last edited:
Through ftp delete function.php or delete the whole theme. Download the last backup of your site from cPanel or whatever you are using, and than replace function.php or the whole theme

However, if you delete function.php or the whole theme you can access your site as admin at yoursite(dot)com/wp-admin and than change the theme
This is soooooo wrong!!!!!


There is a much simpler and safer way to do it. First though you must NEVER edit your main files because when there is another update you will lose any changes you make as wordpress over rides it. First you must get a child theme, this is common practice for wordpress users and is advised by wordpress.org the official site. All changes you make to your site should be done in there and not your main theme.
Once you have your child theme, copy the functions.php file and upload it to your child theme. Go to your adim and editor - Now you can make changes there.
If you make a mistake and your site is messed up just delete the php file in your child theme and your site will return back to normal.
You cannot break a website when using a child theme.


You do not need to delete a whole theme because you made a mistake in one file
You do not need to access admin to change your theme
Simple and quick to do


Wordpress looks in the child theme first, if the changed functions.php ( or whatever page or css ) is present it will use that and ignore the same files in the main code as a child theme over rides it, if changes are not present then wordpress will move on to the main code and use that.


so basically never ever change your main code, always use a child theme. You cannot break a site when using a child theme. That's why professional wordpress users always use a child theme as you cannot lose anything if something goes wrong.
 
actually. at first i deleted my functions.php file through my file manager. then uploaded a new one. this got me to access my site, but all my pages were blank, it turned out i uploaded the file in the wrong folder. so i went back to try and figure out which folder should the file go to but ended up messing it up again and got locked out again.
so i chatted with my host support. asked him to restore my site from last night backup and that's it. it took less than 5 seconds to have my site restored to the way it was before i tried to edit my theme.
 
Seems i might have offended you which wasn't my intention. I was just trying to explain that there is a much easier and permanent way to do it, because you are editing or modifying the core code when there is another update it will get overridden by wordpress. Using a child theme means you only have to do it once
 
Just copy again the functions archive from the original theme
 
Just copy again the functions archive from the original theme
if you use a child theme you will never have to keep doing this, just add it to your child theme and that's it. It will be untouched by future wordpress updates, otherwise you have to keep redoing it after every update, considering there has been 2 in the last couple of months
 
It is generally good practice to create a child theme for wordpress sites. Everything blogandstuff has said is right on the money. Certainly the other solutions offered in this thread will work to solve the problem. However, implementing the general best practice of creating a child theme(which is not that hard) will save more time and energy in the long run than it takes to create the child theme. Once you make it part of your wordpress development process it will be second nature, and you will experience less human-based errors while administrating your site.
 
It is generally good practice to create a child theme for wordpress sites. Everything blogandstuff has said is right on the money. Certainly the other solutions offered in this thread will work to solve the problem. However, implementing the general best practice of creating a child theme(which is not that hard) will save more time and energy in the long run than it takes to create the child theme. Once you make it part of your wordpress development process it will be second nature, and you will experience less human-based errors while administrating your site.
At last someone who understands what a child theme is, i have been trying to convince some of the others the importance of it but it seems to fall on deaf ears, i don't know if it is a showing off kinda thing to suggest rewriting code - deleting themes and such like, it could so much more simpler if only they'd just listen
 
Back
Top