• Resolved Bonnie Walker

    (@bonniew)


    Hi,

    I am building a child theme for Twenty Seventeen and I would really, really, really love to not have the cactus photo as the default header image (out of the box and all) for my theme. I have tried replacing the jpg in the assets location in my child theme and what feels like 100 hacks in the header, template parts, inc, etc and I still end up with the cactus and it’s starting to feel very prickly!

    Yes, I know the customizr can be used but that is not the point. When someone chooses my child theme, I want it to be *my* header image and not have to use the customizr to get rid of it (part of the point of the child theme).

    Any suggestions or help in setting a different default image for header in a child theme?

    Thanks!!

    ~Bonnie

Viewing 3 replies - 1 through 3 (of 3 total)
  • Farook Kholwadia

    (@judgerookie)

    If the header.jpg is in the following directory path: wp-content/themes/twentyseventeen/assets/images/

    and keeps getting pulled as the default

    have you considered replacing it in the main theme directory using FTP?

    No need to reply if you have.

    Thread Starter Bonnie Walker

    (@bonniew)

    Hi JudgeRookie,

    My goal is to never touch a theme that I don’t control and I definitely do not control Twenty Seventeen! Child themes are much safer way to make your own customizations.

    I found the answer in an article at Kinsta.com:

    https://kinsta.com/blog/twenty-seventeen-theme/

    function my_custom_header_args( $args ) {
      $args['default-image'] = get_theme_file_uri( '/assets/images/header.jpg' );
      return $args;
    }
    add_filter( 'twentyseventeen_custom_header_args', 'my_custom_header_args' );
    

    And placed the corresponding image in the child theme /assests/images folder.

    Hopefully, that will save anyone else some time if they want to build a child theme on Twenty Seventeen and have their own default image in the child theme!

    ~Bonnie

    Farook Kholwadia

    (@judgerookie)

    Fanatstic, I’ve learned something too!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twenty-Seventeen Child Default Header Image’ is closed to new replies.