WordPress.org

Ready to get started?Download WordPress

Forums

Share and Follow
Pintrest? (11 posts)

  1. avignonmelimelo
    Member
    Posted 2 years ago #

    Hello,

    Just wondering if you were planning on adding Pintrest to the plugin.

    Many thanks!

    http://wordpress.org/extend/plugins/share-and-follow/

  2. slowfashioned
    Member
    Posted 2 years ago #

    I agree! Developers: please add Pinterest and Google+ to the plugin!!!

    Thanks!

  3. avignonmelimelo
    Member
    Posted 2 years ago #

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

  4. kojala
    Member
    Posted 2 years ago #

    Yes, we definitely need Pinterest, thanks!

  5. andykillen
    Member
    Plugin Author

    Posted 2 years ago #

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

  6. hhamernik
    Member
    Posted 2 years ago #

    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?

  7. aloe4288
    Member
    Posted 2 years ago #

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

    (And, yes, I donated!)

  8. jondaley
    Member
    Posted 2 years ago #

    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.

  9. jondaley
    Member
    Posted 2 years ago #

    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:

    allsites.php:
    '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:
    share-and-follow.php
    http://jon.limedaley.com/share-and-follow.phps
    (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 = '';
    if($page_id){
      $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_the_content(), $matches);
      $image = $matches[1][0];
      if(!$image){
        // 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'));
        if(count($image))
           $image = $image[0];
        else
           $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 = '';
    if($page_id){
    $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.

  10. jondaley
    Member
    Posted 2 years ago #

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

    $image = '';
    if($page_id){
      $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.

  11. hhamernik
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic