please remove empty header image (1 post)

  1. RavanH
    Posted 6 years ago #

    First of all, twenty ten is a nice fresh default theme :)

    One request: after hitting "Remove header image" on the back end, so there is no header image set, the front still shows a big empty area where the image normally would show. This is because even without any header image defined there still is an image tag with height and width showing in the header source.

    This is simply resolved by adding a little if() in header.php like so:
    Replace line 64

    else : ?>


    elseif ( get_header_image() ) : ?>

    This causes the following line

    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />

    to be ignored when there is no header image set ( which would otherwise result in that ugly empty src="" )

    Thanks! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 6 years ago by RavanH
  • This topic is not a support question
  • WordPress version: 3.0