Support » Fixing WordPress » Uncaught Error: Call to undefined function language_attributes()

  • Resolved greencode

    (@greencode)


    I seem to be getting these appear in my error log, but only recently and I’ve been running WordPress sites for years.

    PHP Fatal error: Uncaught Error: Call to undefined function language_attributes() in /home/public_html/wp-content/themes/sitetheme/header.php:2

    My header is

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>

    Any ideas or help would be much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    If you cannot access the dashboard, there are other ways to deactivate plugins.

    Well, I seem to have resolved it. If I have this code:

    <?php
    /**
     * The template for displaying the header
     *
     * Displays all of the head element.
     *
     */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>

    Then it works perfectly with no errors!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught Error: Call to undefined function language_attributes()’ is closed to new replies.