I was having problems with functions in the Aaron child theme in WordPress. I had part of my problem answered in Overwrite parent functions in child function.php WordPress but I couldn’t get the logo to work as a bigger size. I eliminated a lot of code in order to narrow down and find the problem. And what I found is that the function in child theme wasn’t showing up in WordPress. This is the function:
/* Site Logo */
function add_site_icon_support() {
$args = array(
'header-text' => array(
'Site Title Here',
'Your site description goes here.',
),
'size' => 'medium',
);
add_theme_support( 'site-logo', $args );
}
add_action( 'after_setup_theme', 'add_site_icon_support' );
I tested it out by adding it to the functions.php in parent theme and it works. Therefore, I was wondering how to make it work in the child theme?
Does it have something to do with this function in parent theme?
function aaron_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on aaron, use a find and replace
* to change 'aaron' to the name of your theme in all the template files
*/
load_theme_textdomain('aaron', get_template_directory() . '/languages');
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
add_theme_support('woocommerce');
add_theme_support('jetpack-responsive-videos');
add_editor_style();
add_theme_support('post-thumbnails');
add_image_size('aaron-featured-posts-thumb', 360, 300);
add_theme_support('title-tag');
register_nav_menus(array(
'header' => __('Primary Menu', 'aaron'),
'social' => __('Social Menu', 'aaron'),
));
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption'));
}
endif; // aaron_setup
add_action('after_setup_theme', 'aaron_setup');
Since both have the same hooks.
You need to run your hook later than the parent theme. You need to remember, child theme load first, then parent theme.
To make your function work, you need a lower priority, which is a higher number. You can try