WordPress.org

Ready to get started?Download WordPress

Forums

function php operator killed my site (4 posts)

  1. mikep6321
    Member
    Posted 1 year ago #

    I have a problem. I tried to add: add_filter('widget_text', 'do_shortcode'); to make a form work as a widget in the right column.

    The instructions were: To allow shortcodes in sidebar widgets, simply edit the functions.php file from your them and add the following code:add_filter('widget_text', 'do_shortcode');

    I could not find exactly where put this add_filter code so I began experimenting. I figured the worst I could do is to step backwards or get out without changing anything. Bad move. My site is down.

    The error I get is:
    Parse error: syntax error, unexpected '(', expecting '&' or T_VARIABLE in /home/content/03/8353203/html/fyifixit/wp-content/themes/sliding-door.bak/functions.php on line 457

    My site is http://fyifixit.com

    Now I have to fix it.

    I can go back to my FTP file manager and delete the theme. Then reinstall the theme on WordPress admin panel. I have over 300 pages, hundred of pics and art, and lots of other stuff. Naturally I could never be able to recreate everything so what I do not want to do is compound my problem by losing my pages +.

    I was able to get back into my website by renaming the theme to sliding-door.bak (it was sliding-door). I simply cannot get back to the functions php file And go to one of my other websites to bring back the correct php code.

    So the short question is : Can I just remove the corrupt theme back at my FTP file manager? Will that solve my problem?

    I may try that on one of my brand new websites to see if it works.

    Any suggestions would be useful.

    mikep

  2. ggg377
    Member
    Posted 1 year ago #

    I had a similar experience a few days ago, where a corrupt functions.php file took down the whole site including the WordPress control panel. I simply deleted the functions.php of my theme from file manager and uploaded a new one (a backup functions.php file I had on my disk) and that did the trick.

  3. mikep6321
    Member
    Posted 1 year ago #

    I will try that and let you know if that works. Of course it was myself who corrupted the file in the functions.php. I believe I did not return the file to its proper configuration. All the same, I think that might work.

    Thank you

    mike

  4. mikep6321
    Member
    Posted 1 year ago #

    That worked!Yippie!!!
    But probably I should have repaired the one I screwed up in the FTP file manager. I had a copy I could have used to repair. The reason is that the menu's were all messed up. That took only a few minutes. The header was messed up that took just a couple minutes to fix.

    At least I now know a few things I didn't know yesterday. 1. How to get back to the files for the themes I am using and they can be corrected. 2. I can use my files from other hosted sites to retrieve the files I needed to repair my mess up. 3. How to get help right here. 4. And the last thing I know is that I am more dangerous to myself and my websites than I was just a few minutes ago.

    carpe diem

    And thank you ggg377

Topic Closed

This topic has been closed to new replies.

About this Topic