How To Add Logo In Thesis Theme Header

by beyluen on February 3, 2009

in WordPress

Chris Pearson has just released a new version of Thesis Theme, there are a few new and excited features being added. But the fundamental is still the same. The theme has been designed in such a way that it is very flexible and easy in customization.

In this post, I’m going to show you how to add logo in the header of Thesis Theme. By default, Thesis Theme is displaying blog title and tagline in the header. It’s rather ugly and you can make a change to your blog in order for it to stand out from the crowd.

Here are the 3 steps you can easily follow.

#1: Open custom_functions.php

Open custom_functions.php file using any text editor of your choice. The file is located at thesiscustom folder. This file is purposely for you to customize Thesis Theme without touching the core file.

#2 Adding Header Action Hook

Add the following line of code just below <?php in the file. It is adding a hook function custom_image_header to the thesis_hook_header section.

add_action('thesis_hook_header', 'custom_image_header');

#3 Creating Header Function

This is the most important step, creating customized header function. The following code should be added to the custom_functions.php file just below add_action code shown in step 2.

function custom_image_header() {
?>
    <p id="logo"><a href="<?php bloginfo('url'); ?>"><img src="<?php echo '' . get_option('upload_url_path') . '/bh-logo.png'; ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>"/></a></p>
<?php
}

<p id="logo"> It tells you that this paragraph is logo, which is defined in css.

<a href="<?php bloginfo('url'); ?>"> This is the make the logo header as clickable link.

<img src="<?php echo '' . get_option('upload_url_path') . '/bh-logo.png'; ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>"/> This code is responsible for the displaying of header logo. You can change bh-logo.png to the correct logo filename that is uploaded to your uploads folder.

Finally you can see the result in the image file below or you can scroll up to the top and take a look at my header section.

Conclusion

Same as the footer customization and attribution link removal, header customization made easy with the use of hooks. You can refer to Thesis user guide for more information about theme customization using hooks. Enjoy!

Related Posts:

  1. Simple Way To Customize Copyright Footer In Thesis Theme
  2. Customizing Thesis Theme 404 Error Page
  3. Best Way To Remove Footer Link In Thesis Theme
  4. How To Add Custom Background Image In Thesis Theme?
  5. How To Change Background Color In Thesis Theme?

If you enjoyed this post, I would be very grateful if you leave a quick comment below or subscribe via email or RSS or follow me on Twitter. Don't miss out on new blogging tips and online business tips! - Bey Luen

{ 61 comments… read them below or add one }

1 Chris Miller March 10, 2009 at 8:12 am

How can we remove the text that remains after adding the logo?

Thanks!

CM

Reply

2 Bey Luen March 10, 2009 at 10:02 am

@Chris,
You an disable the remaining text by disable the following 2 options in Thesis Options.
- Show site name in header
- Show site tagline in header

Reply

3 Chris Miller March 10, 2009 at 10:12 am

You rock brother….got it licked now. Thanks!

Reply

4 Kelsey March 12, 2009 at 2:28 am

I followed each step, but the image is still not showing in the header. Where should the picture be uploaded to on my server?

Reply

5 Bey Luen March 12, 2009 at 9:42 am

@Kelsey,
The picture should be uploaded to uploads folder. You can configure your uploads folder in Settings->Miscellaneous.
Here is the example of the settings:
Store uploads in this folder: wp-content/uploads
Full URL path to files: http://www.example.com/wp-content/uploads

Reply

6 John March 17, 2009 at 10:53 am

How do you maintain the the Title and Tagline on the left and place the logo on the right side at the same level of the Title and Tagline.

I tried your code and the Picture/Logo displays at the bottom of the Title and Tagline.

Reply

7 Bey Luen March 17, 2009 at 12:09 pm

@John,
There are some tricks to do this. I have emaili you the code. Please let me know if you have issue.

Reply

8 Video Flip Review March 21, 2009 at 4:48 am

Hi,

really appreciate the blog post but I must be doing something wrong:

You did not clarify what happens to the final } however I understand it should appear like this:

function custom_bookmark_links() {
global $post;
?>

<a rel=”nofollow” href=”http://delicious.com/save?url=&title=” onclick=”window.open(‘http://delicious.com/save?v=5&noui&jump=close&url=&title=’, ‘delicious’, ‘toolbar=no,width=550,height=550′); return false;” title=”Bookmark this post on del.icio.us”>Bookmark this article on Delicious

add_action(‘thesis_hook_header’, ‘custom_image_header’);
<a href=”"><img src=”" alt=”" title=”"/>
<?php
}

Were flipVideoLogo.jpg is then that is the file in the location uploads, however I have to create this folder since it did not exist, is that correct?

Thanks
Azzam

Reply

9 Video Flip Review March 21, 2009 at 4:57 am

Hi,
Lets fix that mess in the above comments with the right coding:

/**
* function custom_bookmark_links() - outputs an HTML list of bookmarking links
* NOTE: This only works when called from inside the WordPress loop!
* SECOND NOTE: This is really just a sample function to show you how to use custom functions!
*
* @since 1.0
* @global object $post
*/

function custom_bookmark_links() {
global $post;
?>

<a rel="nofollow" href="http://delicious.com/save?url=&title=" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url=&title=', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious

add_action('thesis_hook_header', 'custom_image_header');
function custom_image_header() {
?>
<a href=""><img src="" alt="" title=""/>
<?php
}

Were flipVideoLogo.jpg is then that is the file in the location uploads, however I have to create this folder since it did not exist, is that correct?

Thanks
Azzam

Reply

10 Bey Luen March 21, 2009 at 8:26 am

@Video Flip Review,
Here is the right coding.

/**
* function custom_bookmark_links() - outputs an HTML list of bookmarking links
* NOTE: This only works when called from inside the WordPress loop!
* SECOND NOTE: This is really just a sample function to show you how to use custom functions!
*
* @since 1.0
* @global object $post
*/

add_action(’thesis_hook_header’, ‘custom_image_header’);
function custom_image_header() {
?>
...
< ?php
}

function custom_bookmark_links() {
global $post;
?>
...
< ?php
}

Reply

11 Azzam March 21, 2009 at 5:36 pm

Did not work for me again.

I got double display of the text version of the logo.
Should I modify the . get_option(‘upload_url_path’) and insert the actual upload position.

How to add the backgroun colour like you have done to yours?

Reply

12 Bey Luen March 21, 2009 at 10:43 pm

@Azzam,
I don’t quite understand your issue about ‘double display of the logo’. Could you show me your example, code or screen capture? I think it will be better for me to prepare a blog post to show you how to change the background color some day next week.

Reply

13 Adrian March 23, 2009 at 6:05 am

Thanks for the great post.

This worked for me on the home page but not on the other pages – any ideas?

Reply

14 Bey Luen March 23, 2009 at 9:37 am

@Adrian,
Do you configure the following in your Settings->Miscellaneous?
Store uploads in this folder: wp-content/uploads
Full URL path to files: http://www.bloghighlight.com/wp-content/uploads

Reply

15 Adrian March 23, 2009 at 4:12 pm

@Bey Luen

Yes – I have set the uploads folder as you suggested. Any other ideas?

Reply

16 Bey Luen March 23, 2009 at 4:37 pm

@Adrian,
I have sent you an email for an alternative solution.

Reply

17 David Zielski March 24, 2009 at 8:28 am

Hi Bey,

I have added the code and I get the “double” thing azzam talked about – see http://www.ecojaunt.com

I have verified the seeting in the misc is correct and the header file is there:

http://www.ecojaunt.com/wp-content/uploads/EcoJauntBlogLogo.jpg

Here is my code I added:

add_action(‘thesis_hook_header’, ‘custom_image_header’);
function custom_image_header() {
?>
<a href=”"><img src=”" alt=”" title=”"/>
<?php
}

Help would be appreciated. Thanks,

Reply

18 Bey Luen March 24, 2009 at 9:30 am

@David,
In the Thesis Options, you need to disable the display of title and tagline to prevent ‘double’ thing. I also notice that you logo doesn’t get displayed. You can use another alternative by changing the img tag to the following.

img src=”http://www.ecojaunt.com/wp-content/uploads/EcoJauntBlogLogo.jpg”

Reply

19 David Zielski March 24, 2009 at 10:21 am

Bey – Thanks, got it working. What size is the header that is normal – WxH in pixels? I can t find it anywhere.

Reply

20 Bey Luen March 24, 2009 at 10:39 am

@David,
Great to hear that. The logo size I’m using is 440 * 75 (width * height).

Reply

21 alex March 31, 2009 at 2:11 pm

i seem to be getting a large chunk of whitespace under my logo, is there any way i can get rid of this?

Reply

22 Bey Luen March 31, 2009 at 2:22 pm

@alex,
Any screenshot or website that I can take a look?

Reply

23 Joomla templates April 7, 2009 at 8:26 pm

Hi Ben,

What would be the normal size of a header (not logo) for the area for the settings of the blog as Page framework and not Full-width framework

thanks
Azzam

Reply

24 Bey Luen April 7, 2009 at 8:38 pm

@Azzam,
There is no fixed answer for the size of a header. It depends on your header design and whether your readers accept it or not. If you need something for reference, you can take a look at my blog’s header as I’m using Page framework.

Reply

25 Adrian May 10, 2009 at 11:26 pm

thanks for this tutorial !!!

how can i add a google adsense picture 486 * 60 i think in the header
is this possible ???

Reply

26 Des May 23, 2009 at 4:49 am

Hi,

Excellent instructions on how to add a logo in the header of the thesis theme!

Thanks for the help with this! Worked great!

How did you get the twitter/RSS/Email icons in the header?

If you have some time, a post about that would be great!

Thanks

Reply

27 Chris May 27, 2009 at 11:45 am

Hi Bey,

The tutorial worked well! …thanks for your help!

I just had one question about spacing. How would I decrease the amount of white space (or margins) above and below the logo?

Thank you kindly for your help, it’s greatly appreciated!

Reply

28 LCD Enclosures June 4, 2009 at 1:15 am

Ben,

can you tell me how to size an image in a header, so that it remains constant, relevant to page size.

Graham Gallagher.

Reply

29 Adam June 22, 2009 at 1:02 pm

How do you make the logo centered in the header box on the page? Right now, my logo is showing up in the header box justified to the left.

Bob

Reply

30 evgeny July 1, 2009 at 2:30 am

hi there,
all done but logo header not appears..
here is a code:
function custom_bookmark_links() {
global $post;
?>

<a rel=”nofollow” href=”http://delicious.com/save?url=&title=” onclick=”window.open(‘http://delicious.com/save?v=5&noui&jump=close&url=&title=’, ‘delicious’, ‘toolbar=no,width=550,height=550′); return false;” title=”Bookmark this post on del.icio.us”>Bookmark this article on Delicious

<a href=”"><img src=”" alt=”" title=”"/>
<?php
}

}

where i kept initial logo name for now.
any ideas?
thanks

Reply

31 Andrew Wong July 5, 2009 at 1:43 am

Great tutorial, thanks. How did you add the RSS feed and Twitter icons in your header?

Reply

32 Guy July 18, 2009 at 11:36 pm

Great article! I changed the logo but I lost the blog’s title and description. Any idea how to bring it back?

http://icelandportal.com

Reply

33 Nivin July 19, 2009 at 11:11 am

Bloody Brilliant Post. 2 secs and I was up and running. Love the work!

Reply

34 Ashley July 30, 2009 at 9:14 pm

Thanks Ben – so far so good :)

One thing is that my header logo doesn’t fit the space of the header area. Can I resize this area, failing that do you know how can I center my logo in the header space?

Cheers :)

Reply

35 Desmond August 2, 2009 at 9:46 pm

Hi Bey Luen

I follow your code above but it did not work. I want to replace the blog title with a logo (jpg file)
add_action(‘thesis_hook_header’, ‘custom_image_header’);
function custom_image_header() {
?>
<a href=”"><img src=”" alt=”" title=”"/>
<?php
}
Can you take a look at my site and advise what steps did I miss ?
Thanks
Desmond

Reply

36 Emeel August 10, 2009 at 7:20 pm

Somehow my blog title and tagline keep apearing on the blog, with my logo under it.
How do I remove the tilte and tagline?

I just added this to my code: add_action(‘thesis_hook_header’, ‘custom_image_header’);

Thanks for the help,
Emiel


function custom_bookmark_links() {
global $post;
?>

<a rel="nofollow" href="http://delicious.com/save?url=&title=" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url=&title=', 'delicious', 'toolbar=no,width=550,height=550'); return false;" title="Bookmark this post on del.icio.us">Bookmark this article on Delicious

<a href=""><img src="" alt="" title=""/>
<?php
}

/* Header Display Above Nav */
remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_after_header', 'thesis_nav_menu');

add_action('thesis_hook_header', 'custom_image_header');

Reply

37 danielthepoet August 13, 2009 at 11:49 pm

I’m encountering two issues:

1. How do I center that logo I’ve just added?
or
2. How do I remove the box from around my logo without removing it from all other images on my site?

You can click on my username to see the site I’m referring to.

Thanks in advance for your help.

Reply

38 tobiCOM August 20, 2009 at 3:39 pm

Doesnt work with Thesis 1.5.1??
Worked with 1.4.x but now on 1.5.1 code doesnt work!

Reply

39 Greg September 15, 2009 at 9:31 pm

Thanks for the amazing code!

Another unrelated question, what plugin gives you the three icons in the top right? Or the yellow box at the end of the post?

Reply

40 pet sugar glider September 18, 2009 at 1:48 pm

thanks now i can change my header to something different, this is exactly what i was looking for

Reply

41 Gustavo :: Gadgets Tips & Tricks October 1, 2009 at 2:32 am

I was trying to put my adsense code instead of an image. But it didn’t work. Do you know what would be the solution for this? I’m also trying to figure how to put google adsense in between the title and content of each post. Let me know if you know where to find this tutorials or if you know how to do it.

Gustavo

Reply

42 judi knight October 18, 2009 at 12:29 pm

I am working on a site that is not on the root directory. http://www.leapdontlook.com/atlantanutrition.com. I cannot get the code to work after trying many configurations. Here is what I have at the lastest:
/* Custom Header Image */

add_action(‘thesis_hook_header’, ‘custom_image_header’);

function custom_image_header() {
?>
<img src=”http://www.leapdontlook.com/public_html/atlantanutrition/wp-content/uploads/food_genie_logo.jpg” alt=”" title=”"/>
<?php
}
I uploaded my image to the wp-content/uploads folder. Now what I get it the blog title twice.

Thanks for your attention to this.

Reply

43 Dave Bass October 31, 2009 at 3:38 am

I got the header part down but how do you move the Title text so it is not overlapped by the header? Like how could you move the title text below or above the image header?

Reply

44 Vikas Gupta November 17, 2009 at 1:18 pm

I liked the way you have customized your thesis; simple but powerful. I will soon self-host and will use the Thesis.

Can you tell me the font size and the name of the font you are using in contents and comments. Thanks. I am following this blog now.

Reply

45 Rajesh Kanuri @ TechCats November 17, 2009 at 8:45 pm

it is not working.. :(

Reply

46 Giorgio Marandola November 19, 2009 at 7:25 pm

Simple and clear! Thank you very much brother !! :-) )))))

Reply

47 Gail December 9, 2009 at 3:12 am

Hi, I followed your instructions, but the logo image comes out above the menu bar, instead of below it. How can I position the logo image to be below the menu bar and above the tagline, like your site does.

Reply

48 Min December 12, 2009 at 3:22 am

grat post…
hey there.. i have the same cuestion.. can u please.. send me the same mail?

tnk u…

John 03.17.09 at 10:53 am
How do you maintain the the Title and Tagline on the left and place the logo on the right side at the same level of the Title and Tagline.

I tried your code and the Picture/Logo displays at the bottom of the Title and Tagline.

7 Bey Luen 03.17.09 at 12:09 pm
@John,
There are some tricks to do this. I have emaili you the code. Please let me know if you have issue.

Reply

49 Nikhil December 28, 2009 at 1:08 am

Hello , Thanks for all your mods .
I have added logo to my website successfully . Now i want to add my website’s tagline below the logo image just as your website’s Tagline !

Help me

Reply

50 aviationMY January 3, 2010 at 8:05 pm

Hi,

Thanks for the tutorial, by the way,
how to add the RSS, email, tweets stuff with all those links like yours in header??

if found your header is very eye-catchy and all the good stuff like social networking goes first before the content, nice idea!

Reply

51 aviationMY January 5, 2010 at 10:34 pm

John 03.17.09 at 10:53 am
How do you maintain the the Title and Tagline on the left and place the logo on the right side at the same level of the Title and Tagline.

hi..regarding your reply as above>>

can you send me the same thing that you sent to him??

i found your header is so brilliant!

Thank you

Reply

52 Den January 6, 2010 at 7:30 pm

Thanks, finally its done. But there are few important concern, where your help will be apreciated:
- How to remove the white space surrounding the logo
- How you put tagline below the logo
- How to put twitter and subcribe button on the right in the same level of logo
- Is it possible to put category navbar below logo

You can check the page www dot equitycalling dot com where I am doing it

Reply

53 Claudia January 10, 2010 at 5:10 am

Hi,

I am completely new to Thesis, and no nothing about html.
I followed your instructions on how to add a logo in thesis theme header.
There appears a box with an x on my website, so i think the settings for a logo are there but somehow it does not link to my actual logo.
With an FTP program I uploaded my picture to this file: /public_html/wordpress/wp-content/uploads, the name of my logo is citizenwinesupply.png, and citizenwinesupply.png i put into custom.functions.php.

I hope you can help me
This is the full code I have in custom.functions.php

<a href=”"><img src=”" alt=”" title=”"/>

<a rel=”nofollow” href=”http://delicious.com/save?url=&title=” onclick=”window.open(‘http://delicious.com/save?v=5&noui&jump=close&url=&title=’, ‘delicious’, ‘toolbar=no,width=550,height=550′); return false;” title=”Bookmark this post on del.icio.us”>Bookmark this article on Delicious

<?php

}

Reply

54 Justin January 17, 2010 at 9:51 am

This helped, but the highlighting has got to go…

Thanks for the info. ~J

Reply

55 Sean February 14, 2010 at 11:42 am

Thanks for this. This helped me out in fixing my thesis theme. Logos are vitally important for me.

Reply

56 Cumhur April 11, 2010 at 4:05 am

You are amazing. Thank you thank you.
All the best
CD

Reply

57 beyluen April 11, 2010 at 10:57 am

@Cumhur,
You’re welcome! Hope you like my other Thesis tips, :)

Reply

58 Cumhur April 11, 2010 at 3:17 pm

Yes! Your site is something. Many things I was looking for found here. Thank you very much.

Reply

59 michael April 19, 2010 at 10:36 am

i would like to make the logo in two colors the word black and the second white…how do I adapt the code to accomplish that…i assume that i use <span in reference to the words and add the color in css in some form…any help so much appreciated

Reply

60 Marc May 28, 2010 at 3:41 am

I have Thesis 1.7, and followed the instructions to the letter. It didn’t work, unfortunately.
The HTML that is output doesn’t contain the tag in the header. What’s up?

Reply

61 Marc June 1, 2010 at 11:31 pm

Okay I got it to work finally! I had forgotten to close the comment in the custom functions php file :)

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: