Support » Fixing WordPress » Changed code in function.php, broke my site completely

  • Hi all

    I added a line into my functions .php file. This resulted in a critical error. I logged in in ‘safe mode’ and tried to delete it but got this below. Bear in mind that I never touched header.php. I simply added the one line of code into functions.php.

    Any help would be greatly appreciated. Thank you.

    Your PHP code changes were rolled back due to an error on line 58 of file wp-content/themes/neve/header.php. Please fix and try saving again.

    Uncaught Error: Call to undefined function neve_body_attrs() in wp-content/themes/neve/header.php:58
    Stack trace:
    #0 wp-includes/template.php(770): require_once()
    #1 wp-includes/template.php(716): load_template(‘/home/storage/5…’, true, Array)
    #2 wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
    #3 wp-content/themes/neve/page-templates/template-pagebuilder-full-width.php(19): get_header()
    #4 wp-includes/template-loader.php(106): include(‘/home/storage/5…’)
    #5 wp-blog-header.php(19): require_once(‘/home/storage/5…’)
    #6 index.php(17): require(‘/home/storage/5…’)
    #7 {main}
    thrown

Viewing 3 replies - 1 through 3 (of 3 total)
  • lisa

    (@contentiskey)

    -can you download an unmodified copy of the theme’s functions.php file and replace it in your theme? if the only change was in the functions.php file, that should help repair the error.
    -if you are using a webhosting vendor with cPanel, you can access your theme’s file folder in the file manager to replace the file in your theme’s folder.
    -otherwise, start a new topic in the theme’s specific support team for additional guidance. https://wordpress.org/support/theme/neve/

    Moderator t-p

    (@t-p)

    Did you make a backup copy of functions.php before modifying it? If you have, try restoring it.

    If not, try replacing it with a fresh copy of functions.php file.

    Or re-upload your currently active neve theme. That should replace the file with bad code.

    If you insist on using the code, contact neve theme’s support and ask why it does not work with their theme: https://wordpress.org/support/theme/neve

    Error points to the fact that the code in header.php file is calling a function named neve_body_attrs that isn’t found – maybe you changed something with that function in functions.php file?

    Maybe you deleted something by accident when adding that one line?

    Can you access your files directly from the hosting cPanel?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.