Friday, January 22, 2010

How to add a logo to wordpress site

Step 01: Login to wordpress admin panel.
Step 02: Under the Appearance section click on Editor.

Step 03: The header.php file controls the logo section of a wordpress site. So open the header.php file for edit.

Step 04: Find out the section <div id="header"> within header.php. Within <div section, id="header"> you will see a line something similar.

<h1><a href="<?php echo get_option('home'); ?>"><?php bloginfo('name'); ?></a></h1>

Step 05: Delete the part
<?php bloginfo('name'); ?>
from above line. If you want to know what does <?php bloginfo('name'); ?> mean then please have a look at temaplate tags from Introducing wordpress theme.

And replace the deleted part with this line:

<img src="the url to image" alt="site logo" />

If your image name is logo.jpg and you keep it under images folder then it should look like,

<h1><a href="<?php echo get_option('home'); ?>">
<img src="images/logo.jpg" alt="site logo" />
</a></h1>


Step 06: Update the file and check load the url of your wordpress home page to see how it looks. You can use image height, width property to resize your logo but it is always better first resize by photoshop/gimp and then use it as logo.

Related Documents
http://arjudba.blogspot.com/2010/01/how-to-transfer-wordpress-site-to-new.html
http://arjudba.blogspot.com/2010/01/introducing-wordpress-theme.html
http://arjudba.blogspot.com/2010/01/how-to-install-wordpress.html

1 comment:

  1. hay friends thanks for info. i love wordpress this blog make easy for editor and simple

    ReplyDelete