CREATE CUSTOM PERMALINKS FOR ALL BLOGGER POSTS.

 On Senin, 02 Juli 2012  

You might have noticed some blogs having shortened urls at the top/bottom of every post with a “Share this post” text. This is a very nice widget which can help increase your blog's traffic as visitors won't have to go through the stress of manually getting your posts url.

How to add shortened url to your blog.

In this tutorial,I 'll be making use of bit.ly i.e twitter's default service. bitly.jpgTo begin,you will have to create an account with bit.ly to get your API KEY.Once gotten,we can begin with the tut.

STEP BY STEP TUTORIAL.

Login toBlogger&go to Design/Layout » Edit HTML.[Always remember to backup your template.]Check the box next to Expand Widget Template and search for </head> by pressing CTRL+F.On getting that,Copy-Paste the code below directlyabove/before

<script type="text/javascript" charset="utf-8" src="http://bit.ly/javascript-api.js?version=latest&amp;login=USERNAME&amp;apiKey=YOURAPIKEY"></script> <script type="text/javascript" charset="utf-8"> BitlyClient.addPageLoadEvent(function(){ BitlyCB.myShortenCallback = function(data) { // this is how to get a result of shortening a single url var result; for (var r in data.results) { result = data.results[r]; result['longUrl'] = r; break; } document.getElementById("shorturl").innerHTML = "Share this link: &lt;input type='text'value='" + result['shortUrl']+ "' name='bitlyurl'/&gt;"; } BitlyClient.shorten(document.location, 'BitlyCB.myShortenCallback'); }); </script>

Replace USERNAME with the name you supplied while registering at bit.ly and also replace YOURAPIKEY with the key assigned to your account.

STEP 2»

Search for this line of code[CTRL+F]

<div class='post-footer-linepost-footer-line-3'>PLACE SCRIPT HERE</div>

Replace “PLACE SCRIPT HERE” in the code above with this»»

<b:if cond='data:blog.pageType =="item"'><form id='shorturl'/></b:if>

Now,Preview & Save your template.

You should now have a shortened url in all your blog posts. If you encountered any problem trying this,don't hesitate to leave a commen behind.

CREATE CUSTOM PERMALINKS FOR ALL BLOGGER POSTS. 4.5 5 Unknown Senin, 02 Juli 2012 You might have noticed some blogs having shortened urls at the top/bottom of every post with a “Share this post” text. This is a very nice ...


Related Post:

  • RANDOM BANNER WIDGET FOR BLOGGER BLOGS.There are so many reasons you might want to add a banner to your blog site.Adding a “Random banner widget” makes it better for any website.It helps to manage space and is very useful in promoting affiliate links.So in this tutorial,I'll be giving you… Read More
  • HOW TO ADD “ADVERTISE WITH US” WIDGET TO BLOGS.Nowadays,almost every blog has an “Advertise with us” widget in their sidebar. The widgets in most cases,are in the dimension '125 by 125' which is the most commonly used in the blogosphere.So,if you'd like to embed this widget in your blog,all you h… Read More
  • HOW TO ADD “ONLINE HTML CALCULATOR” TO BLOGS.Here's a quick tool-script you can add to your website/blog to display online calculator.Once a number or sign is clicked on,the page reloads with the option in the text area.Here's a demo of this online application. … Read More
  • HOW TO ADD A “PRINT PAGE” BUTTON TO BLOGGER BLOGS.Adding a “Print Page” button to a blog is another way of generating little traffic to it,as visitors are given the option to print an entire article without stress,and by so doing can boost the traffic of your blog through Word-of-mouth,online forums… Read More
  • AWESOME FACEBOOK LIKE,STUMBLE,RETWEET & DIGG COUNTER WIDGET FOR BLOGS.Here's another cool Share-buttons widget for blogs. It's a 4-in-1 share widget with an awesome look and counters.Well,I must confess,this is one of the most widely-used Social-media widget in the Blogosphere.It includes the Facebook Like button,Digg … Read More

Tidak ada komentar:

Posting Komentar