Support » Theme: Clean Retina » editing header-extensions.php in child theme

  • Resolved Ricky


    Hi there,

    First of all, I love this theme. Very useful and well designed!

    I’m editing how the header image resizes and to accomplish the desired effect, I need to add a div around the header image in the header-extensions.php file, like this:

    <div id="header-border">
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><img src="<?php echo $header_image; ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"></a>
    </div>	<!-- end header-border -->

    I’m using a child theme and everything was working fine until I reached this point. When I made a copy of header-extensions.php and added it to the child theme folder, it didn’t override the existing header-extensions.php file.

    As a test, I edited this file in the parent theme and this extra div works great, but I obviously don’t want to edit the parent theme files. What should I do to make the child header-extensions.php file override the parent file?

    Thanks in advance,

Viewing 1 replies (of 1 total)
  • Hi Ricky,

    Just making the copy of header-extensions.php file in the child theme will not be able to overwrite the code.
    Only the template files like header.php, footer.php and others are overwritten by the child theme file of the same name but
    not the functionality files.

    You need to unhook the function i.e. cleanretina_headerdetails hooked to cleanretina_header action hook.
    Then add you own function all similar with cleanretina_headerdetails just making the changes that you want
    and hook it to cleanretina_header action hook.
    All this coding can be inside the functions.php file of you child theme.

    Go through this link , this tutorial shows how its done.


Viewing 1 replies (of 1 total)
  • The topic ‘editing header-extensions.php in child theme’ is closed to new replies.