• Resolved MaximumResults

    (@maximumresults)


    I discovered an issue with changing the header image size in a child theme for the twentyeleven theme.

    I’m adding filters on the twentyeleven_header_image_width and twentyeleven_header_image_height hooks. That’s working fine. I also changed the “max-width” in the style.css for the child theme to match the new image size.

    However, in the admin pages, the new image was still displaying wrong. On the admin pages, there was styling that still had “max-width: 1000px; in the styling for the #headimg CSS ID.

    I resolved this by copying the entire twentyeleven_admin_header_style() function from the twentyeleven (parent theme) functions.php into the functions.php for my child theme. I then changed the line that read:
    max-width: 1000px;
    to this:
    max-width: <?php echo HEADER_IMAGE_WIDTH; ?>px;

    Is there a reason this wasn’t handled that way in the actual twentyeleven theme files? It seems that if the line were changed like that in functions.php for the twentyeleven theme, it would work with any child theme that changes the size of the header image without having to duplicate all that extra code.

  • The topic ‘Changing Header Image in a Twenty-Eleven Child Theme’ is closed to new replies.