Wordpress - How to insert a logo in the header?

Try modifying the header section a bit to comply with the standards. Here is what your code right now:

<div id="header-image">
   <img width="1102" height="350" alt="" class="header-image" src="http://onofri.org/example/wp-content/uploads/2013/06/header1.jpg">
</div>

Here is how you can modify the things:

<div id="header-image">
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
       <img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="Logo" width="HERE" height="HERE" />
    </a>
</div>

There are only 3 steps now:

  • Instead of using the theme's default header image settings, you can edit your theme's header.php with the code given above.
  • Instead of inserting image from the Add New Media, you can upload image via cPanel (Control Panel of your web host) into the theme folder's sub-folder named 'images'.
  • And instead of making a huge image with background for your logo, try making a simple background-less logo in Photoshop (or any graphics software) - in case of Photoshop, just do it: after placing the logo image in a layer, just delete the background layer and then save the image for web (File > Save for web... [Ctrl + Alt + Shift + S]) and choose the format PNG-24 for a good result. Then save it as logo.png and place it to the '/wp-content/themes/simplemarket/images/' folder.

Hope you get the rest. If any question, please feel free to comment here under.


If there is a "logo" functionality, it will be part of the theme. Perhaps a theme option or part of the theme customization system.

I typically use a Custom Header to do this for commercial sites, though a custom header is not specifically for a logo. It is a generic "header image" function.

In short, this depends on the theme. If it is a theme you are creating, you can edit the theme to add it. See the Codex articles already referenced.


To change the header image go to the admin panel of your wordpress. In the appearance menu click on header and there you will find the option to upload your header image and Text to appear in your header.

If it's not showing then you have to edit your header file and insert the following code in your header if it does not exist already.

<?php $header_image = get_header_image();
    if ( ! empty( $header_image ) ) : ?>
        <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>