Sharing Images from Website to Your Pinterest Boards

Sharing Images from Website to Your Pinterest Boards

At OpenSource technologies, we are developing an exciting website in Joomla which includes sharing images on Facebook, Twitter and Pinterest. There are thousands of links which provide a code that lets you “pin” images found on any website to your own virtual boards and share those pictures.

Here’s the method that shows how you can share only specific and required images to the Pinterest board direct from your website. The code below is in PHP. You can easily modify the code as per the language you are using for coding.

 

Place the code below on your webpage:

$site_address=”http://www.abc.com/”; // Store your site name in a variable

$image_url=”http://www.abc.com/pic_1.png”; // Store image URL in a variable. Again you may dynamically change image name via coding.

<a href=”http://pinterest.com/pin/create/button/?url=<?php echo

$site_address;?>&media=<?php echo $image_url; ?>&description=words” target=”_blank” >Pin It</a>

 

Do not forget to include the script below on your page along with the above code:

<script type=”text/javascript” src=”//assets.pinterest.com/js/pinit.js”></script>

After placing the above code, a ”Pin It’ button will be displayed on your web-page. Once the user clicks this button, he will be asked to login to his Pinterest account and the image mentioned in the code will be shared into the board of his choice. Simple!

Tweak the code as per your requirement. Your suggestions are welcome.

 

Coming next… Sharing large images from website to your Facebook account.

Latest Blogs