How to add custom header image (what is PHP/HTML code?) (2 posts)

  1. RyanHoeppner
    Posted 2 years ago #

    I added the support in the functions file to add a custom header image but I'm not sure what PHP/HTML to add in the (div id="header) for it to work properly. My text won't disappear even if I uncheck the "Show header text with your image." Please help! I'm looking mostly for some code options here. I've tried looking over wordpress codex.

  2. kevinhaig
    Posted 2 years ago #

    The twentyeleven theme goes into it in it's header.php file.

    Here's what I used to display just a logo...no text.

       if( function_exists( 'get_custom_header' ) ) {
          $header_image = get_header_image();
          If ( $header_image ) : ?>
              <div class="header_image">
                 <a href="<?php echo site_url(); ?>/">
                    <img class="logo"
                    src="<?php header_image();?>"
                    height="<?php echo get_custom_header()->height; ?>"
                    width="<?php echo get_custom_header()->width; ?>"
                    alt="logo" />
              <?php endif; } ?>

    Hope it helps!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.