How to add Pinterest Button on WordPress Attachment file

See How to Add Pinterest “Pin It” to WordPress for introduction
Codes in article above may work for Posts, but there’s a little tweak for Pinterest Pin It button on attachment.php to work

<div class="pinterest">
<a href="<?php the_permalink(); ?>&media=<?php echo wp_get_attachment_url(); ?>&description=<?php the_title(); ?> on <?php bloginfo('url'); ?>" class="pin-it-button" count-layout="vertical"><img border="0" src="//" title="Pin It"></a>


Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: