Notice: Function add_theme_support( ‘html5’ ) was called incorrectly
The notice you’re seeing indicates that the add_theme_support('html5')
function was called incorrectly in your WordPress theme or plugin. This function is used to declare support for various HTML5 features in your theme.
To resolve this wordpress error, you should review the code where the add_theme_support('html5')
function is being called and make sure it is used correctly. Here are a few things to consider:
- Correct function syntax: The function call should use parentheses
()
instead of square brackets[]
as you posted in your question. The correct syntax isadd_theme_support('html5')
. - Correct hook placement: Make sure the
add_theme_support('html5')
function is being called from the appropriate hook. It should generally be placed within a callback function that is hooked into theafter_setup_theme
action hook. For example:
phpCopy codefunction my_theme_setup() {
add_theme_support('html5');
}
add_action('after_setup_theme', 'my_theme_setup');
- Check for typos: Double-check that there are no typographical errors in the function name or its parameters. Even a small mistake can cause the notice to appear.
By following these guidelines, you should be able to resolve the “called incorrectly” notice for the add_theme_support('html5')
function.