wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Add pinterest “Pin It” button to your wordpress blog

wordpress snippet

Adding a pinterest button to a wordress blog is simple! Place the first snippet in the functions.php of your wordpress theme. Once that is done add the next snippet into the location you wish to display the Pint It button within the single.php template file.

snippet :  PHP - functions.phpcopy
function pin_js(){
   echo '<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>';
}
add_action('wp_footer','pin_js');
snippet :  PHPcopy
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&description=<?php the_title_attribute(); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a>

Did you like this post? If so please share it with your friends. Thanks!