I am creating my first WordPress theme for personal use, when I added main function in functions.php, website showing an warning on top.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'myfirsttheme_setup ' not found or invalid function name in G:\wamp64\www\mysite\wp-includes\class-wp-hook.php on line 287.
Should I define myfirsttheme_setup function first? If yes, then how?
My code is here:
<?php /** * @package myfirsttheme * @since myfirsttheme */ if ( ! function_exists( 'myfirsttheme_setup' ) ) : /** * support post thumbnails. */ function myfirsttheme_setup() { add_theme_support( 'custom-header' ); add_theme_support('menus'); add_theme_support('post-thumbnails'); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); add_theme_support( 'customize-selective-refresh-widgets' ); } endif; // myfirsttheme_setup add_action( 'after_setup_theme', 'myfirsttheme_setup' );