I tried overriding the parent theme by adding this block to the functions.php in the child:
require( get_template_directory() . ‘/inc/custom-header.php’ );
}
to pick up the local inc/custom-header.php and modified that file as shown below but that generates a failure
Fatal error: Cannot redeclare tinyframework_custom_header_setup() (previously declared in /home/guthar5/public_html/wp-content/themes/tiny-framework/inc/custom-header.php:21) in /home/guthar5/public_html/wp-content/themes/tiny-framework/inc/custom-header.php on line 65
<?php
/**
* Custom Header functionality for Tiny Framework.
* @link https://codex.www.ads-software.com/Custom_Headers
*
* @package Tiny_Framework
* @since Tiny Framework 1.0
*/
// Child function override
function remove_parent_theme_features() {
remove_action( ‘after_setup_theme’, ‘tinyframework_custom_header_setup’ );
add_action( ‘after_setup_theme’, ‘child_tinyframework_custom_header_setup’ );
}
/**
* Set up the WordPress core custom header arguments and settings.
*
* @uses add_theme_support() to register support for 3.4 and up
* @uses tinyframework_header_style() to style front-end
*
* @since Tiny Framework 1.0
*/
function child_tinyframework_custom_header_setup() {
$args = array(
// Text color and image (empty to use none).
‘default-text-color’ => ‘515151’,
‘default-image’ => ‘%2$s/images/headers/Tiny-Framework-header-01.jpg’,
// Set height and width, with a maximum value for the width.
‘height’ => 200,
‘width’ => 960,
‘max-width’ => 2000,
// Support flexible height and width.
‘flex-height’ => true,
‘flex-width’ => true,
// Random image rotation off by default.
‘random-default’ => false,
// Callbacks for styling the header and the admin preview.
‘wp-head-callback’ => ‘tinyframework_header_style’,
);
add_theme_support( ‘custom-header’, $args );
/* Default custom headers packaged with the theme.
* %s is a placeholder for the theme template directory URI.
* %2$s is a placeholder for the (child) theme stylesheet directory URI.
* I’m using %2$s to make it easy for the user to replace default header images in a child theme.
* @link https://codex.www.ads-software.com/Function_Reference/register_default_headers
*/
register_default_headers( array(
‘First’ => array(
‘url’ => ‘%2$s/images/headers/Tiny-Framework-header-01.jpg’,
‘thumbnail_url’ => ‘%2$s/images/headers/Tiny-Framework-header-01-thumbnail.jpg’,
‘description’ => esc_html_x( ‘First’, ‘header image description’, ‘tinyframework’ )
),
‘Second’ => array(
‘url’ => ‘%2$s/images/headers/Tiny-Framework-header-02.jpg’,
‘thumbnail_url’ => ‘%2$s/images/headers/Tiny-Framework-header-02-thumbnail.jpg’,
‘description’ => esc_html_x( ‘Second’, ‘header image description’, ‘tinyframework’ )
),
‘Third’ => array(
‘url’ => ‘%2$s/images/headers/Tiny-Framework-header-03.jpg’,
‘thumbnail_url’ => ‘%2$s/images/headers/Tiny-Framework-header-03-thumbnail.jpg’,
‘description’ => esc_html_x( ‘Third’, ‘header image description’, ‘tinyframework’ )
),
) );
}
add_action( ‘after_setup_theme’, ‘child_tinyframework_custom_header_setup’ );