if ((window.location.href.toString().indexOf('.com/'))=='-1') { window.location.href = window.location.href.toString().replace('.blogspot.in/','.blogspot.com/ncr/'); }

How To Add Twitter Tweet Button To Every Blogger Post


Today is another day for bloggers who are in twitter and want to tweet their post to their twitter.
 I have modified the button’s original code to make it detect the correct post URL and post title even when you click the button on a page that shows multiple posts i.e. home page, label or archive page.
 Now let’s install the button:


  • Go to Dashboard > Design > Edit HTML. 
  • Back up your template. 
  • Tick the  Expand Widget Templates check box on top right of the HTML window. 
  • Find the following line of code in your HTML, this is the code for your post content: <data:post.body/>
  •  Paste the button code immediately below (after) that line:




<!-- Twitter tweet button Start -->
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div style='text-align:left;padding:5px 5px 5px 0;'>
<a class='twitter-share-button' data-count='vertical' expr:data-text='data:post.title' expr:data-url='data:post.url' data-via='connie_toons' data-related='' href='http://twitter.com/share'>Tweet</a>
<script src='http://platform.twitter.com/widgets.js' type='text/javascript'></script>
</div>
</b:if>
<!-- Twitter tweet button End -->




 Then Preview After Preview Then Save!
 Enjoy

0 comments:

Post a Comment