Add Pinterest "Pin It" Counter Button To Blogger

Thursday, July 19, 2012 0 comments

Adding the "Pin it" button

Please don't edit the code below and neither add it inside Tables or div sections because the JavaScript is not well scripted and is sensitive to slightest of change in styling. Use it as given. I will publish fresh posts on how to add it to [a href="http://www.mybloggertricks.com/2011/07/add-google-button-social-networking.html"]sharing widget below post titles[/a] and to the [a href="http://www.mybloggertricks.com/2011/08/add-floating-facebook-share-1-button.html"]floating share widget[/a].

  1. Go To Blogger > Template
  2. Backup/restore your template
  3. Click the Edit HTML button
  4. Click Proceed
  5. Click the box "Expand Widget Templates"
  6. Search for this code:

<data:post.body/>

   Now if you wish to add the count button below post titles then you will have to paste the coming codes just above the code in step#6 otherwise if you wish to display the button at the bottom of posts then add the coming codes just below step#6 code.

      7.  Paste the following code below or above (depending on your choice of location) the code in step#6

 

For horizontal count Use this code:

horizontal pin it

<a class='pin-it-button' count-layout='horizontal' expr:href='&quot;http://pinterest.com/pin/create/button/?url=&quot; + data:post.url'>Pin It Now!</a>
<a href='javascript:void(run_pinmarklet())' style='margin-left:-93px; width:43px; height:20px; display:inline-block;'/>
<script src='http://assets.pinterest.com/js/pinit.js' type='text/javascript'/>
<script type='text/javascript'>
function run_pinmarklet() {
var e=document.createElement(&#39;script&#39;); e.setAttribute(&#39;type&#39;,&#39;text/javascript&#39;);
e.setAttribute(&#39;charset&#39;,&#39;UTF-8&#39;);
e.setAttribute(&#39;src&#39;,&#39;http://assets.pinterest.com/js/pinmarklet.js?r=&#39; + Math.random()*99999999);
document.body.appendChild(e);
}
</script>

For Vertical count Use this code:

<a class='pin-it-button' count-layout='vertical' expr:href='&quot;http://pinterest.com/pin/create/button/?url=&quot; + data:post.url'>Pin It now!</a>
<a href='javascript:void(run_pinmarklet())' style='margin-left:-46px; width:43px; height:20px; display:inline-block;'/>
<script src='http://assets.pinterest.com/js/pinit.js' type='text/javascript'/>
<script type='text/javascript'>
function run_pinmarklet() {
var e=document.createElement(&#39;script&#39;); e.setAttribute(&#39;type&#39;,&#39;text/javascript&#39;);
e.setAttribute(&#39;charset&#39;,&#39;UTF-8&#39;);
e.setAttribute(&#39;src&#39;,&#39;http://assets.pinterest.com/js/pinmarklet.js?r=&#39; + Math.random()*99999999);
document.body.appendChild(e);
}
</script>

      8.   Save your template and you are all done!

 

 

How it works?

Need help?

Follow this easy tutorial and let me know if you needed any further assistance. We have tried to add all necessary codes to make things work. the variable data:post.url is only included and we did not included one for thumbnails because it is more wise to let the visitor choose a thumbnail of his choice rather forcing him to select one that you automatically provide.  Have fun exploring this new social media bird and we will make sure to educate you with its proper use. Do not forget to Pin this post! :) Peace and blessings pals.

Source: http://www.mybloggertricks.com/2012/04/add-pinterest-it-counter-button-to.html
Share this article :

Post a Comment

 
Copyright © 2012. Blogger Tips For Beginners - All Rights Reserved
The information is compiled from various sources on the internet