• Resolved Gone Fishin

    (@terryg-1)


    I am trying to create a TwentyThirteen child theme. The child theme would like to use a different header image size. But there is a problem…

    The width and height of the header image are not defined in functions.php as is mentioned in Change Dimensions of WordPress Custom Header.

    They are defined in the ‘inc/custom-header.php’ file which is require’d at line 37 of functions.php using get_template_directory().

    I think that if get_stylesheet_directory() had been used, I would be all set. But it wasn’t.

    Can anyone please tell me, how can I create a TwentyThirteen child theme, with a child-defined custom header, without hacking on the parent theme, and thereby, losing what I see as the main benefit of a child theme (that of it not breaking on updates)?

    Thanks,
    Terry

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can call add_theme_support() in your child theme’s functions.php and WordPress will use those settings, rather than the parent theme’s settings, even though the parent theme supports custom headers in a separate file.

    <?php
    $args = array(
      'height' => 200,
      'width'  => 800
    );
    
    add_theme_support( 'custom-header', $args );
    Thread Starter Gone Fishin

    (@terryg-1)

    That worked great! Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem creating child theme due to custom header call’ is closed to new replies.