Saturday, May 17, 2008

Swap Blogger Title Hack - Error Free!

by Archit Tantia 33 comments



Share this post: StumbleUpon | Reddit | Technorati

Blogger recently changed the way the layout codes are processed which prevented Blogger users to change their layout through the Page Elements Layout tab while using the Swap Title hack. Nobody could find a solution to this till now. Blogger introduced a new layout tag "blog.pageName" recently which gave me an idea to solve the Swap Title problem. I tested my method on this blog and guess what? It works just fine!

So without wasting any more time here is the all new "Error Free" Blogger Swap Title Hack:

  1. Backup your blog's template just to be safe.
  2. Find this code in your template:
    <title><data:blog.title/></title> or <title><data:blog.pageTitle/></title>
  3. Replace the above tag with this:
    <!-- Blogger Swap Title by Archit T at http://blog.archit.in -->
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <title>
    <data:blog.pageName/> | <data:blog.title/>
    </title>
    <b:else/>
    <title><data:blog.pageTitle/></title>
    </b:if>
    <!-- End of Blogger Swap Title by Archit T at http://blog.archit.in -->
  4. Save your template and you're done!

This hack does not return any XML errors which the older Swap Blogger Title Hacks do and it also lets you change your template layout through the Page Elements Layout tab! :)

Enjoy blogging and if you want more tips on blogging, you could subscribe to my blog feed.


Comments 33 comments
sachinKT said...

thanks Archit.finally i found the answer for my problem....

subtle yet sheep said...

Dude I'm excited about this - thanks for the code it works AND I can arrange page elements without breaking the XML - nice work. I have been searching for this code for Months.

Archit Tantia said...

:)

M-Freeman said...

Thank you so much! It worked perfectly on my blog .

Emails 4 All said...

Hi Friend,
After going through so many posts about this issue with buggy code, at last, I got the simple and perfect solution from your post... Thanks and keep the good work..
I modified my blog as per your instructions and is working fine.

Thanks again. ;-)

Manpreet Singh said...

It works!thanks...

Gautam said...

thanks archit...
it was a nice tweak...

check out my tech blog at
http://technofreak.co.nr

boffin said...

hey archit i did exactly as u have said but my post title and blog title did not get swapped...pls help yaar....

Archit Tantia said...

@boffin You have 2 Title tags in your blog template. Remove the title tag which is on the 3rd line of your template and this hack would work just fine.

Let me know if you are not able to solve the problem.

MySpace Macedonia said...

Very useful hack.
Thank you!

Hilal said...

The only hack that worked for me, I've tried various title hacks for blogger by others but none worked..thanks!

Hilal said...

http://www.hilalscricket.com/

See it in action works great!

smokemachine said...

No way not to say: THANK YOU!
I tried 2 other ways before I reach your post, but neither worked for me.
And, in my blog the tags that I had to replace were:
title data:blog.pageTitle/ /title - that might be because I'm using custom template.
I think you should include this in the post, so the newbies won't give up on the first paragraph.

Archit Tantia said...

@smokemachine You are welcome smokemachine! Glad that this hack helped you.

Thanks for the correction though. I had already did the modification to the post but somehow forgot to publish it. Sorry for the inconvenience caused; the post has been updated.

Thank You!

Anonymous said...

Hi, this does not seem to be working for me. My blog can be found at www.welcometogower.co.uk - any help really would be appreciated.
Cheers,
Chris

Archit Tantia said...

@Anonymous The hack is working perfectly fine on your blog. While on the post pages, the title shows the post header first and then the blog title.

Chris Elphick said...

Thanks Archit - I guess it was just me being stupid. Thanks for all your help.

Ned said...

Hello, nice work though from some reason very small number of my posts appear before the blog title, and only on google, and not yahoo. I implemented this hack two weeks ago. Advice? my blog is http://totalka.blogspot.com

Thanks
Ned

Archit Tantia said...

@Ned The search engines take time to index your pages. Ping Google and Yahoo and they will slowly change their old indexes.

MusicmuziK said...

I implemented in my site Cool it's working.
Well I request Archit can know how to show post description under post title in search engine's

Archit Tantia said...

@MusicmuziK Hello MusicmuziK, you just need to add this META Tag to your blogger template: <meta content='YOUR DESCRIPTION HERE' name='description'/> under your blog's <head> template.

If you need to show different description for different posts of your blog, then use the hack I posted a few days ago:
http://blog.archit.in/2008/08/add-different-meta-tags-to-different.html


Cheers!

Analyst said...

Thanks I have implemented same at Free Indian stock tips> and now will be seeing whether I get the requisite advantage or not.

groat said...

I tried many in the past but this is the only one that worked.Thanks a million.Cheers.

Great technology deals updated regularly
http://brillantdeals.in

शैलेश भारतवासी said...

thanks.. I changed it for my blog http://podcast.hindyugm.com

it has really worked

Bank said...

hey archit i did exactly as u have said but my post title and blog title did not get swapped...

I am not use two title tag

Archit Tantia said...

@Bank: I checked you blog. It looks like you didn't save the changes.

Please follow the instructions again and this time be sure to save it! :)

Cheers!

nabster said...

Hi Archit, I tried the instruction that you gave here but it seems not working on my blog? Do I need to put something on the code that you've provided or not? When I did that and make a preview of it, the template change. I don't know if there is something wrong. here is my blog http://onlinecabalbot.blogspot.com

Archit Tantia said...

@nabster: Hey nabster, I checked your blog and looks like the hack is working just fine on your blog.

pixelshots said...

i haVE IMPLEMENTED.. NO ERRORS, BUT THE SWAPPING NOT DONE.. just showing the title of my blog alone there.. what to do?.. can u point any possible problems frnd.. i have done the same before some time.. and worked, now its not ..

Archit Tantia said...

@pixelshots I just checked your blog and seems the hack is working just fine.

The main page will just show the blog's title but the single blog post pages will show the post title first and then the blog's title.

Cheers!

Anonymous said...

Hello Guru, what entice you to post an article. This article was extremely interesting, especially since I was searching for thoughts on this subject last Thursday.

rH3uYcBX

Anonymous said...

I love this site! Thank you sooo much for all your posts!

Anonymous said...

Thank you so much for your siteI love everything about it.

Archit Tantia
Blogger, Web Consultant and Programmer

Chat | Contact Me | Personal Website

Subscribe to feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe via RSS Feed Recent Entries

Sponsored Links

Subscribe via RSS Feed Recent Comments

Technorati

Technorati
My authority on technorati
Add this blog to your faves

Drop Your Card