* * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * * @package Adaptativo */ /** * Set up the WordPress core custom header feature. * * @uses adaptativo_header_style() */ function adaptativo_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'adaptativo_custom_header_args', array( 'default-image' => get_template_directory_uri().'/img/background-header.jpg', 'default-text-color' => '#fff', 'wp-head-callback' => 'adaptativo_header_style', ) ) ); } add_action( 'after_setup_theme', 'adaptativo_custom_header_setup' ); if ( ! function_exists( 'adaptativo_header_style' ) ) : /** * Styles the header image and text displayed on the blog. * * @see adaptativo_custom_header_setup(). */ function adaptativo_header_style() { adaptativo_header_image(); adaptativo_header_text_color(); } function adaptativo_header_image(){ if ( has_header_image() ){ $header_image = get_header_image(); } else{ $header_image = get_theme_support( 'custom-header', 'default-image' ); } ?>