• After updating to the latest version of WordPress, the site encountered a fatal error related to an undefined function in the theme’s functions.php file. The error message reads: “Fatal error: Uncaught Error: Call to undefined function my_custom_function() in /wp-content/themes/mytheme/functions.php on line 78.” This issue has caused the front end to display the error and made the WP Admin dashboard inaccessible. The problem likely stems from a missing or deprecated function, requiring either a theme update or adjustments to the functions.php file for compatibility with the latest WordPress version.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @emmasss

    The error is likely due to a missing or outdated function. Check if my_custom_function() is defined in the theme’s functions.php file or any included files. If it’s missing, you can add a check to prevent the error:
    if (!function_exists('my_custom_function')) { function my_custom_function() { // Function code here } }
    If you need an easier solution, install the “Code Snippets” plugin to safely add the function without directly editing theme files.

    Does the error message really say “mytheme” and “my_custom_function”? If so, then someone has used rather unfavorable names when creating the theme. And if it is a custom theme, you would have to contact its developer for clarification.

    Incidentally, the functions.php mentioned belongs to the theme you are using. It has nothing to do with WordPress, unless it calls functions that WordPress provides. If it is the latter, then the theme must be adapted accordingly. Please contact the theme developer in this case too.

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