Translate This Blog
Remember To Always Back Up Your Template Before Attempting Any Of The Tweaks On This Site

Gadgets Inside Header

You can add a Gadgets inside your header rather it be search box or ads. Pretty much what ever you want you can place inside your header.

1. Go to Dashboard > Design > Edit HTML.
2. Find This code below.

<b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
<b:widget id='Header1' locked='true' title='My Test  Blog (Header)' type='Header'/>
</b:section>

3. Insert the following code just below that.

<b:section id='header-right' showaddelement='yes'/>
<div style='clear: both;'/>

4. Should look something like this after your done.

<b:section class='header' id='header' maxwidgets='1' showaddelement='no'>
<b:widget id='Header1' locked='true' title='Tweak My  Blogger (Header)' type='Header'/>
</b:section>
<b:section id='header-right' showaddelement='yes'/>
<div style='clear: both;'/>
Now we should have 2 sections to the Gadget sections in the header. But you will have to position it correctly.

5. Now you will want to locate the following code.

]]></b:skin>
6. Add the following code just above it.
(Older Templates)
#header {width:50%;display:inline-block;_float:left;}
#header-right {width:35%;display:inline-block;float:right;padding:15px 15px 15px 15px;}
#header-right .widget {margin:0;}
body#layout #header {width: 50%; float: left;}
body#layout #header-right {width: 50%; float: right;}
(Newer Templates)
#header {width:50%;display:inline-block;_float:left;}
#header-right {width:35%;display:inline-block;float:right;padding:15px 15px 15px 15px;}
#header-right .widget {margin:0;}
If you are using a newer template you will need to locate this code below.
]]> </b:template-skin>
Just above that code place this code below.
#layout #header {width: 50%; float: left;}
#layout #header-right {width: 50%; float: right;}
7. Now apply this to your blog and go to the Page Elements. In the Page Elements you should see the widgets area now available. Place a Gadget in there.

8. Now you might have to go back to the code in section 6 and change the width around in the first 2 lines. Play around with it untill you get it to your liking. You can just click preview after you changed it to see what it looks like. As for the orange padding you will need to adjust this to move the gadget around on the blog. You can view our section on padding and margin if you do not understand the values.

27 comments:

Anonymous said...

thank you so much!

AiresOFwar said...

It may seem like it don't work from the page elements because the gadgets will not line up side by side. But the Add Gadget just below the header is the place you want to add the new gadget. Then when you view your blog it will show the gadget to the right of your header.

DeanneM said...

Hi Aires, nice hack! It doesn't seem to be displaying properly on my blog in Explorer (cursed browser). In Explorer, it wants to be below the header, just above the tabs. Any ideas on a fix?

AiresOFwar said...

Try adjusting the percent in red to a lower number.
If your still having problems I will need your blog URL to correctly isolate the issue.

Leslie Mosher said...

Was there a solution to AiresOFwar's problem?

AiresOFwar said...

Are you having the same issue as DeanneM then let me know so I can run some test on different template to come up with a solution. IE has always been a pain to with code compatibility. But I think I can come up with a solution if I can duplicate this issue on a test blog. I just need to know what template your are using.

Web Design Hyderabad said...

Thanks for post

Pedro Cunha said...

Hi! The post is amazing, learned a lot today ;) I even created an header-left b:section.

But getting to the point, following your tutorial strictly, the two gadgets dont lineup, and the header stays centered on the add element page.

AiresOFwar said...

Thanks for the heads up I will look into it.

Suresh R said...

Thanks for helping to fix my problem in splitting the header(title). if you want to split the header exacly half, use the following code....

#header {display:inline-block;_float:left;}
#header-right {display:inline-block;float:right;padding:15px 15px 15px 15px;}
#header-right .widget {margin:0;}
body#layout #header {width: 50%;}
body#layout #header-right {width: 50%;}

Helen Luanda said...

I too am using IE. I have split the header which is great, and now have a gadget box showing next door to the header on the Page Elements. But when I turn it into a text box and display it, it displays below the header and to the right of it. Changing the percentages still doesn't allow me to display the box in the right place. I have tried giving it an "absolute" coordinate, but whatever I put in as the coordinates it resolutely stays in exactly the same place. As though it is not recognising the GadgetID Text1. Any thoughts?

AiresOFwar said...

Do you have a bog URL to go with that so I can see what your seeing?

Electrician in Toronto said...

Out of topic Q:


How do I add HTML or a gadget to the right hand side of the existing footer where the share buttons and edit pencil tabs are located?

AiresOFwar said...

Ummmmmm I don't know of anyway off head, maybe later on I will look into it and see if I can figure it out.

Helen Luanda said...

Will leave it set up displaying incorrectly for a while so you can see it. Afterwards I will reposition text under header until I can resolve problem.

This is what is currently in my CSS box. I have tried resizing the picture to make it smaller, but it makes no difference.

#header {width:50%;display:inline-block;_float:left;}
#header-right {width:30%;display:inline-block;float:right;padding:20px 10px 10px 10px;}
#header-right .widget {margin:0;}

AiresOFwar said...

Use a code like this below in the CSS box.

#Text3 {
position: relative;
bottom: 10px;
right: 15px;
}

You may have to adjust the pixels to your liking.

Helen Luanda said...

OK, now we are getting somewhere. You are such a clever chap! But there is now a large gap under the header and text box before the rest of the page continues. On the page elements there is an "add gadget" box which I haven't used. Could this be causing it? I can't seem to get rid of it.

Helen Luanda said...

Have just solved my own problem, by applying the last bit of advice you gave me to the other boxes on the page. Not sure why they were in the wrong place but seem to have shifted them satisfactorily. Many thanks

Helen Luanda said...

Hmmm. Thought all was well until a friend told me that when she looks at the site on her Mac the writing on the right hand side is over the top of the photo..... Is this a factor of screen size, or different operating systems do you think?

AiresOFwar said...

I never used Mac computers before but it sounds more likely that she is using a older browser. Some browsers interpret coding different while older ones may not support it at all. If she has a mac then likely she is using safari so ask her to make sure her browser is not outdated. Also ask her to look at it in Firefox and Internet Explorer and see if it looks different. But I am unaware of any problems with Mac or any browser not rendering the tweak properly. So please let me know what she says about her browser so I can look into it.

Helen Luanda said...

She is using Safari, but is pretty sure it is up to date. Having seen how it displays on her screen, I think it would in fact have displayed correctly in Safari without the tweaks I have had to put in place to make it look right in IE. Are the two incompatible?

AiresOFwar said...

Browser compatibility is a endless nightmare for a programmer or web-designer. Although I am unaware of any problems between Safari and Internet Explorer it is possible. Each browser rendered coding different which makes for a fun time when designing sites. Firefox is the best browser and most sites are optimized for Firefox browsers.

Helen Luanda said...

So I wonder which bit of the header splitting code IE wasn't recognising, before I started relocating. It looks as though Firefox and Safari can recognise whichever bit IE is ignoring and therefore they don't need the relocation tweaks. If I can identify which bit that is, then perhaps it can be rewritten in a way that IE can understand ...

AiresOFwar said...

Send me a email through the contact and we can work it out through there. I will get you to attach your template in a email and I will see what I can do.

Adetony said...

Hi AiresOFwar,
Your is tweak is great i must confess, it has really help me to customise my blog exactly the way I love it, keep up the good work.
Trying to put gadget inside has been given me some problem now, another gadget shows up and i try to put the one I created tru your guidline but i could not figure it out well. will attach my template to my email and mail you.
thank you once again for the good work.

Silvia Masaracchio said...

Thank you so much!!! It works perfectly!!
My blog: http://bachecaebookgratis.blogspot.com/

Krishanu Chattopadhyay said...

Thank you very much....

Post a Comment

Please don't post hyperlinked text within the comment box! It will not be published and you will be marked as spam.

Web Design Blogs PageRank