Adding a custom Logo to Slate Theme
by ravin on Oct.29, 2010, under Wordpress
In this tutorial, we are going to look at how to add a custom logo image to the header section of the Slate theme. This is a topic that comes up regularly. If you are using the theme for a business, this is particularly important, as your logo is the centerpiece of good branding.
In order to follow this tutorial, you will need to have access to the server on which your WordPress platform is hosted. You will also need to create a logo image. If you are not comfortable with creating logos and would like assistance, feel free to contact us through the form at the bottom of the page. Let’s dig right in.
Using FileZilla or a similar program, access the root folder where your blog is hosted. Navigate to /wp-content/themes/slate/images. Upload you logo image here, and we are ready to jump into the code.
Open your WordPress admin panel and select the Editor option under Appearance. On the right side of the screen, you will see a list of the pages that make up the Slate theme. Select Header, which corresponds to the file header.php. Look for this code:
<div id="headertitle">
<h1><?php bloginfo('name'); ?></h1>
</div>
<div id="tag">
<?php bloginfo('description'); ?>
</div>
This is the section of html that describes the elements at the top right of the screen. The container called headertitle contains the large blog title at the very top right of your blog. The container called tag contains the small blog description that is positioned directly below the title.
In this instance, I am going to replace both of these items with my new logo. You might decide that you would like to keep one or both of these and simply add the logo image, and that works just as well. We will look at how to do both.
Let’s create the code we will add to header.php to include the logo:
<div id="logo">
<img src="<?php bloginfo('template_url'); ?>/images/slate-logo.png" alt="" height="66px" width="175" />
</div>
What we have created here is a container called logo that we will use to position the our image. The image tag includes the code ?php bloginfo('template_url');, which tells WordPress to look in the directory of the current theme, which, in this case, is Slate. The rest of the url is self evident, but do remember to change the name of the image file and the height and width to match the logo image that you uploaded.
In header.php add this code either with the existing header objects or in place of them. If you add the logo but keep the title and description, your code should look like this:
<div id="header">
<div id="logo">
<img src="<?php bloginfo('template_url'); ?>/images/slate-logo.png" alt="" height="66px" width="175" />
</div>
<div id="headertitle">
<h1><?php bloginfo('name'); ?></h1>
</div>
<div id="tag">
<?php bloginfo('description'); ?>
</div>
<div id="nav">
<ul>
If, on the other hand, you would like to replace the title and description, you should finish with code like this:
<div id="header">
<div id="logo">
<img src="<?php bloginfo('template_url'); ?>/images/slate-logo.png" alt="" height="66px" width="175" />
</div>
<div id="nav">
<ul>
Remember to replace my file names with yours! Okay, now let’s see what the visual effect has been. Here is the Slate demo site, with my new logo and without the title and description.

I am reasonably happy with this, but what if I would rather position it on the right side of the header, where the blog title was before? To make these changes we will open the page called Stylesheet, which corresponds to the file style.css. Scroll down the page to until you see this code:
/*********************header*****************************/
#header {
position:relative;
width: 960px;
height: 160px;
margin: 0px auto 0px;
}
#contenttop{
position:absolute;
bottom:0px;
width:100%;
height:21px;
}
#headertitle {
position:absolute;
top:15px;
right:20px;
}
#headertitle h1{
font: 50px Arial, Helvetica, sans-serif;
color: #ffffff;
}
#tag{
position:absolute;
top:70px;
right:20px;
color: #459dcb;
font: 11px Arial, Helvetica, sans-serif;
}
This is the CSS that describes the objects in the header. If you removed the blog title and blog description, you can delete #tag{everyting}, #headertitle {everyting}, #headertitle h1{everyting}. To position the logo image, we will style the logo container. This is what it should look like:
#logo {
position:absolute;
top:30px;
right:30px;
}
This tells the viewer’s browser to position the logo div 30 pixels from the top and 30 pixels from the right side of the div header. Depending on the size and shape of your image, you may choose to alter the positioning right-left, or top-bottom, to fit your needs. Here is the final effect:

November 1st, 2010 on 6:48 pm
Many thanks very much for that information. I’ve been searching for this for a while with Bing and it has been a serious task.
November 4th, 2010 on 2:47 am
ha, I will test my thought, your post get me some good ideas, it’s really amazing, thanks.
- Mark
November 5th, 2010 on 6:08 am
It took me a long time to search on the web, only your site explain the fully details, bookmarked and thanks again.
- Lora
November 10th, 2010 on 7:45 am
Good day!This was a really splendid subject!
I come from milan, I was fortunate to discover your theme in baidu
Also I get much in your subject really thanks very much i will come every day
November 12th, 2010 on 6:45 pm
I don’t usually respond to articles but I’ sure will in this case. Truly a big thumbs up for this 1!
November 21st, 2010 on 5:33 am
Great information! I’ve been looking for something like this for a while now. Thanks!
November 26th, 2010 on 11:14 am
The content on this publish is really a single of the top material that I’ve ever occur across. I love your article, I’ll appear back to verify for new posts.
December 6th, 2010 on 1:46 am
Couldn’t be drafted any more appropriate. Reading this post brings back memories of my recent room mate!
December 7th, 2010 on 12:16 am
Hello all ! I want to leave 0.2cents that this post is totally superb, fine describes the topic and have almost all important informations. I’d like to see more posts like this
December 8th, 2010 on 6:38 am
We can’t obtain so that you can your 2009 posts. May anyone provide me personally this hyperlink?
December 9th, 2010 on 7:12 pm
Every time I stumble upon a good blog post I do one of three thing:1.Share it with my close contacts.2.save it in all my best sharing websites.3.Be sure to visit the same blog where I read the post.After reading this post I am seriously thinking of doing all of them!
December 10th, 2010 on 8:42 am
Struggling to find attempting for a short time for any smart study focused on this particular subject . Looking around in Yahoo I finally noticed this web site. Looking at this kind of review I’m just thrilled to state that I get a positive feeling I located just what I was ready for. I most certainly will be sure to remember this web-site and check it out constantly.
December 28th, 2010 on 3:13 pm
thanks, interesting article
December 29th, 2010 on 12:39 am
I love your blog theme can you tell us the name of it or where you downloaded it? thanks.
January 1st, 2011 on 1:13 pm
Just popping in to say nice site.
January 3rd, 2011 on 8:54 pm
You made some decent points there. I looked on the internet for the subject and found most persons will go along with with your blog.
January 4th, 2011 on 8:39 am
Bravo, is simply magnificent idea
January 28th, 2011 on 4:46 am
As a Newbie, I am permanently browsing online for articles that can benefit me. Thank you
January 28th, 2011 on 1:16 pm
Brilliant blog posting. I found your post very interesting, I think you are a brilliant writer. I added your blog to my bookmarks and will return in the future.
January 28th, 2011 on 1:53 pm
I impressed, I have to say. Actually not often do I encounter a weblog that both educative and entertaining, and let me let you know, you have hit the nail on the head. Your idea is excellent; the problem is one thing that not sufficient individuals are speaking intelligently about. I am very joyful that I stumbled across this in my search for something relating to this.
January 29th, 2011 on 3:47 am
Definitely, what a great blog and revealing posts, I definitely will bookmark your site.Best Regards!
January 30th, 2011 on 3:55 am
Of course, what a splendid site and illuminating posts, I definitely will bookmark your blog.All the Best!
February 1st, 2011 on 1:48 am
Keep functioning ,remarkable job!
May 10th, 2011 on 12:45 pm
Hi, i feel that i saw you visited my site so i came to “go back the prefer”.I’m trying to in finding things to enhance my site!I assume its adequate to use some of your ideas!!