WordPress.org

Ready to get started?Download WordPress

Forums

Instapress
[resolved] Link Back to users photo on Instagram? (12 posts)

  1. chrislowthian
    Member
    Posted 1 year ago #

    Is it possible to Link back to the users photo on Instagram when viewing the Instagram Photo in Fancybox?

    Either by Clicking on the Photo or via a text link under the Photo saying "Comment" or something similar?

    It would make my site allot more social by allowing users to comment on the photos.

    Any help adding this in would be great.

    http://wordpress.org/extend/plugins/instapress/

  2. estrellaexplores
    Member
    Posted 1 year ago #

    I would also like to know the answer to this question. I would like to link it back to my http://instagrid.me/ page.

  3. liechtenecker
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    unfortunately this isn't possible in the current version by default, but we'll thinking about including it in the future.

  4. eberger3
    Member
    Posted 1 year ago #

    I had some luck linking the photo's title back to Instagram by changing this line on instagram.php (short code use) and widget.php (side bar widget)

    // jQuery Fancybox
    case 'fancybox':
    $result .= '<a>images->standard_resolution->url.'" rel="instagram-sc-images" title="'.$title.'">';

    to:

    // jQuery Fancybox
    case 'fancybox':
    // Custom code to link title to Instagram
    $result .= '<a href="'.$obj->images->standard_resolution->url.'" rel="instagram-sc-images" title="<a href="'.$obj->link.'" target="_blank">'.$title.'</a >"">';

    This assumes that all of your Instagram photos will have a title.

    Just keep in mind that if the developer issues an update that this change will get overwritten.

  5. estrellaexplores
    Member
    Posted 1 year ago #

    I just ended up putting a link at the bottom. Hopefully they do upgrade the widget to link back through the photos.

  6. swissm1ss
    Member
    Posted 1 year ago #

    eberger3,

    Love your solution but didn't have any luck. Got a line #?

    I would love to have a link to the instagram post - the way it does when fancybox isn't enabled - on the title/caption OR append the title with the link, "view on instagram".

  7. eberger3
    Member
    Posted 1 year ago #

    On my code editor it is line #340 in the instapress/instagram.php file. I did find an error on my earlier post. You need use the html codes for your special characters in some spots. Try:

    $result .= '<a href="'.$obj->images->standard_resolution->url.'" rel="instagram-sc-images" title="<a href=&quot;'.$obj->link.'&quot; target=&quot;_blank&quot;>'.$title.'</a >"">';

    Let me know how you make out.

  8. eberger3
    Member
    Posted 1 year ago #

    and on instapress/widget.php it is on line #120

  9. chrislowthian
    Member
    Posted 1 year ago #

    So I am guessing you can add a link under the Instagram Picture in FancyBox?

    If so whats the best code to use?

    Thanks

  10. chrislowthian
    Member
    Posted 1 year ago #

    After trying eberger3's code:

    $result .= '<a href="'.$obj->images->standard_resolution->url.'" rel="instagram-sc-images" title="<a href=&quot;'.$obj->link.'&quot; target=&quot;_blank&quot;>'.$title.'</a >"">';

    It works fine BUT when you hover over the thumbnails it shows the link HTML in the Title which is not so great :-(

    Is there a way to have the picture title then a link next to it saying "Click Here to Like or Comment"

    This would be sooooo much better but beyond my coding skills.

  11. eberger3
    Member
    Posted 1 year ago #

    Yeah, the issue is that the plugin uses the title= attribute in the thumbnail anchor tag to determine the title of the Fancybox image. When an anchor tag has a title most browsers will display the yellow tooltip or helper on hover which in our case includes the ugly html. According to Fancybox's documentation you should be able to use the thumbnail images alt tag to populate the title but I haven't gotten this to work.

  12. Pereira
    Member
    Posted 1 year ago #

    eberger3, how about including the username just before the caption? would that be simple to accomplish?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic