Support » Plugins and Hacks » [Plugin: Share and Follow] Pintrest?

[Plugin: Share and Follow] Pintrest?

Viewing 10 replies - 1 through 10 (of 10 total)
  • I agree! Developers: please add Pinterest and Google+ to the plugin!!!


    Google+ is already available, but Pintrest would be a huge plus.

    Yes, we definitely need Pinterest, thanks!

    Plugin Author andykillen


    try donating or subscribing to the CDN. It might spark the “developers”, me in to action much quicker.

    I noticed Pinterest.com is available on the Follow tab but not on the Share tab. Am I missing something? Is it not available to on the Sharing tab?

    PINTEREST!!! Please add that one to the share options!

    (And, yes, I donated!)

    It isn’t on the sharing tab, because one has to grab the picture that you want to share. I originally thought I could just add it to the allsites.php, but it turns out it is harder than that.

    I’m working on a solution to this – probably by doing it the way the “social-discussions” plugin does it, by using some javascript to grab the appropriate image.

    My solution is harder than the general purpose solution, because my images are from an image custom field, rather than the associated image with the blog post.

    If I get something working that will be useful to others, I’ll post it here.

    And,,, it’s done. It wasn’t too bad, though maybe a little hacky/only for me.

    What my version does:
    1. Adds the option for pinterest to be selected on the various menus on the admin side:

    'service' => 'share,follow',
    'share_url' => "http://pinterest.com/pin/create/button/?url=URI&media=MEDIA&description=TITLE",

    2. Replaces MEDIA with the url of an appropriate picture:
    (Unfortunately, the share-and-follow plugin seems to be no longer in the wordpress repository? and I didn’t think to keep an original copy before I edited it. If someone has an original, I can do a proper diff on the file.
    Basically, all I did was to add a new parameter to the replaceKeywordsInURL function that looks for MEDIA and replaces it with the image URL.

    The image URL is calculated in social links:

    $image = '';
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
      $image = $matches[1][0];
        // you might like this function instead: get_post_meta($page_id, 'image', true);
        $image = recipress_recipe(get_post($page_id), 'photoraw', array('max' => 1, 'size'=>'medium'));
           $image = $image[0];
           $image = '';

    I’m using the “recipress” plugin, though the author was apparently not interested in my modifications and so never responded to my emails about how to send her my code, so I have a heavily customized version (and the above call won’t work for you), so you might just like this version instead, which doesn’t look for custom fields:
    $image = ”;
    $output = preg_match_all(‘/<img.+src=[\'”]([^\'”]+)[\'”].*>/i’, get_the_content(), $matches);
    $image = $matches[1][0];

    This will look for the first image in a blog post and use that image to share on pinterest.

    Oops – had a character typo, here is the last bit of code from the above post in a nicer format:

    $image = '';
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
      $image = $matches[1][0];

    This will look for the first image in a blog post and use that image to share on pinterest.

    Thanks Jondaley

    I found this code online which displays all the images on the page. You choose which one to share.

    <a class="floatLeft shareButtonImg" href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());"><img src="http://passets-cdn.pinterest.com/images/pinterest-button.png" width="78" height="26" alt="Pin It" onclick="doPinIt();"/></a>

    Is it possible to merge this onto Share and Follow?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Share and Follow] Pintrest?’ is closed to new replies.