• Hi,

    I was making changes to my main functions.php file and accidently uploaded it to the theme rather than to the main folder. So I overwrote the one I had for my theme, for which I do not have a backup and which has been modified considerably from the original theme file.

    Is there any other way I could find it? I cannot find it in the trash of my fta access. I can still see a cached version of the page which looks fine. Is there any way to do it from that?

    The page is https://www.rilab.cl. I have put some code from the original theme now so it at least shows up but many functions are no longer working.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am guessing you don’t have a local copy of your site where you edit the files and then upload?

    Check with your webhost and see if they do daily backups and, if so, see if they can restore the file from a couple days ago.

    Thread Starter tanmtl

    (@tanmtl)

    Of course I don’t, that would be too smart!

    I usually do but it was just a quick easy edit and so I figured I wouldn’t need it.

    Good suggestion, I will contact them!

    Or you could download the theme again and extract the functions.php file from the zip and use that. Or is that the one you modified? You overwrote the default theme functions.php file with your custom file? I’m confused about which file is which.

    Thread Starter tanmtl

    (@tanmtl)

    Unfortunately, that won’t work. As I said, I had modified my functions file with some snippets from other developers to do specific things, for example put a footer and create category grids. I have now put the original theme code so at least something shows up, but I really need a solution that will restore my old file. I am also taking suggestions as to how to better do this in the future. Like maybe I should modify a secondary functions file?

    Are you using a child theme? That’s where your custom functions should go.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Overwrote functions.php from Theme’ is closed to new replies.