Langsung ke konten utama

How To Add Tweet This Links To Your Blogger Template (With Short Urls)

Twitter has become one of the most popular ever syndication and networking tools for bloggers. A few readers have asked if it is possible to add a "Tweet This" link to our Blogger templates, and while this was possible, I had not discovered a method of automatically shortening the URL of our blog posts until now.

Luckily for us, Bit.ly have created a JavaScript-based solution which shortens the URL to just a few characters and enables bloggers to add a Tweet This link configured for their posts. In this tutorial, I'll explain how you can add this to your Blogger template so your readers can Tweet your posts to their Twitter followers, enabling your Blogger posts to be syndicated to a wider audience.


Editing your template to add the Twitter links

First of all, you should make a full back-up of your existing template (which you can later restore if you make a mistake in the coding). To do this, go to Layout>Edit HTML in your Blogger dashboard and click on the "Download full template" link near the top of the page. Save your template to a location on your computer which you can easily access later.

Next, go back to the Layout>Edit HTML page and ensure you have checked the "Expand widget templates" box. The place where we need to add the Twitter code is contained within the Blog Posts widget.

Search for this section in your Blogger template code (or similar):

<div class='post-footer-line post-footer-line-1'>

If you cannot find this exact line of code, search for 'post-footer' instead. Alternatively, you can add your code immediately after the <p><data:post.body/></p> line.

Just after the 'post-footer' line you have located, paste the following section of code:

<b:if cond='data:blog.pageType == "item"'><span style='float: left; background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY5lXIrvnMdM0_kQE7cSUVX1KMhnsnksixHbyOi-tAHhsbE1afU07uStRMelnJe68fSdxDB5I13aWb-p9ukHcIgkTFoYUFnfHMs1bniHW8vETSvFVG9O-NW1UbI-a4tACUZdlNF9hReQJD/s128/twitter-16x16.png) left no-repeat; padding-left: 20px;'><script charset='utf-8' src='http://bit.ly/javascript-api.js?version=latest&amp;login=tweettrackjs&amp;apiKey=R_7e9987b2fd13d7e4e881f9cbb168f523' type='text/javascript'/>
<script charset='utf-8' src='http://s.bit.ly/TweetAndTrack.js?v=1.01' type='text/javascript'/>
<a expr:onclick='"return TweetAndTrack.open(this, \"" + data:post.url + "\");"' href='#'>
<span style='display:none;'>I'm reading: <data:post.title/></span>Tweet this!</a></span></b:if>

Preview the changes to your blog template to make sure you have not made any errors in adding the code. If all is well, the preview page should load (though you will ne unable to see the Twitter link on the preview page).

Finally you can save your template. Now when you view an item page on your blog, you will see a link in the post-footer section which looks like this:

I'm reading: Tweet this!


This link automatically generates a Bit.ly shortened URL for your post. When a reader clicks on this link, they are taken to Twitter.com (where they can log in if required) with a pre-filled Tweet which appears like this:

http://bit.ly/url I'm reading: [title-of-blog-post]

If you would prefer the prefilled Tweet to say something other than "I'm reading", you can edit this phrase in the code you add to your Blogger template. Readers can edit this pre-filled Tweet before updating if required.

I hope you will enjoy using this Twitter syndication link in your own Blogger templates. Please try this out for yourself to see how it works and feel free to leave your comments below.

Komentar

Postingan populer dari blog ini

How To Add A Music Player In Blogspot

Since this archived post was written in 2007, web design and Blogger templates have changed immensely. The development of HTML5 and <audio> tags enable us to add music to our Blogspot websites and posts far more simply, and with improved control. In preparation for explaining how to podcast with Blogger, this tutorial explains how to easily add an HTML5 mp3/audio player to your blog posts or layout. No JavaScript, Flash or plugins are required, and with a fallback for older browsers which don't support the player. I've even created a simple form to generate basic tags for you! Adding music to your Blogspot site has never been so easy! Basic HTML5 Audio Tags Explained The <audio> tag is a new feature of HTML5 which we can use to natively embed audio playback in our sites. It is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari, and can be set to play the linked audio file automatically (autoplay) or loop if required. Here...

Import Blogs From Another Service To Blogger With The Google Blog Converters Project

A few months back, Blogger announced the ability to import and export Blogger hosted blogs. At the time, it was not possible to import blogs from any other service to Blogger, which left many of us a little disappointed though wondering when this service could be made available. Well it seems there is hope that Blogger can make such a service available through our Blogger dashboards soon enough! Today the the Google Blog Converters project : an open source project which aims to make available the ability to import/export feeds from many different blog platforms: This new Open Source project provides the ability to easily move blog posts and comments from service to service. This initial release provides Python libraries and runnable scripts that convert between the export formats of Blogger, LiveJournal , MovableType , and WordPress . In addition, the source code includes templates for hosting these conversions on Google App Engine . Future additions to the project will includ...

Download Mp3 - Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia)

download lagu 123 Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia) - download lagu terbaru blackpink lisa moments i think about a lot- free download lagu mp3 Blackpink Lisa - Lili [FMV] Alan Walker, K- & Emelie Hollow - Lily- download lagu mp3 full 【BLACKPINK】Gaon Chart Kpop Awards -download lagu 123 MP3 bts & blackpink | mma , Semua Lagu-Lagu, Video dan Lyrics tersedia disini, Semua Musik ini berasal dari Youtube.com dan gratis untuk didownload. Belilah Lagu Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia) dan kasetnya di Toko Terdekat Maupun di iTunes atau Amazon secara legal, ini hanya sebagai Review dan Promosi saja. Video Terkait Video Download MP3 Parodi Blackpink - dududu At D&#;Academy Indonesia Dance Solo by Ivonne Rose (Anak Indonesia) Download MP3 blackpink lisa moments i think about a lot Download MP3 Blackpink Lisa - Lili [FMV] Alan Walker, K- & Emelie Ho...