1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need some urgent help

Discussion in 'Blogging' started by bimmerime, Sep 28, 2015.

  1. bimmerime

    bimmerime Regular Member

    Joined:
    May 14, 2015
    Messages:
    283
    Likes Received:
    18
    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?
     
  2. bimmerime

    bimmerime Regular Member

    Joined:
    May 14, 2015
    Messages:
    283
    Likes Received:
    18
    don't worry about it. i'm just a noob . i got it fixed
     
  3. fidodido

    fidodido Junior Member

    Joined:
    Aug 12, 2015
    Messages:
    113
    Likes Received:
    27
    Can you share how did you fix it so others (including me) could learn from this ?
     
  4. Eri001

    Eri001 Newbie

    Joined:
    Dec 6, 2014
    Messages:
    23
    Likes Received:
    1


    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: Sep 28, 2015
  5. blogzandstuff

    blogzandstuff Elite Member

    Joined:
    Jan 1, 2015
    Messages:
    5,170
    Likes Received:
    2,387
    Occupation:
    blog creator
    Location:
    UK
    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.
     
  6. Ellie4294

    Ellie4294 Regular Member

    Joined:
    Apr 14, 2015
    Messages:
    469
    Likes Received:
    71
    Occupation:
    Freelancer
    Location:
    Online
    Good to hear you have figured it out soon :D
     
  7. bimmerime

    bimmerime Regular Member

    Joined:
    May 14, 2015
    Messages:
    283
    Likes Received:
    18
    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.
     
  8. blogzandstuff

    blogzandstuff Elite Member

    Joined:
    Jan 1, 2015
    Messages:
    5,170
    Likes Received:
    2,387
    Occupation:
    blog creator
    Location:
    UK
    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
     
  9. blogzandstuff

    blogzandstuff Elite Member

    Joined:
    Jan 1, 2015
    Messages:
    5,170
    Likes Received:
    2,387
    Occupation:
    blog creator
    Location:
    UK
    i think in some round about way you agree with me, maybe wrong as i'm not too sure what you mean
     
  10. asfrankito

    asfrankito Registered Member

    Joined:
    Jul 15, 2012
    Messages:
    65
    Likes Received:
    10
    Just copy again the functions archive from the original theme
     
  11. blogzandstuff

    blogzandstuff Elite Member

    Joined:
    Jan 1, 2015
    Messages:
    5,170
    Likes Received:
    2,387
    Occupation:
    blog creator
    Location:
    UK
    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
     
  12. ChanzGrande

    ChanzGrande Elite Member

    Joined:
    Feb 16, 2008
    Messages:
    2,484
    Likes Received:
    1,172
    Occupation:
    Accountant
    Location:
    Northern Woods Counting Money
    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.
     
    • Thanks Thanks x 1
  13. blogzandstuff

    blogzandstuff Elite Member

    Joined:
    Jan 1, 2015
    Messages:
    5,170
    Likes Received:
    2,387
    Occupation:
    blog creator
    Location:
    UK
    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