BuddyDev

Search

I need a way to share single images from a gallery to facebook?

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24862

    Can’t seem to find a solution to sharing single images from a gallery. I use an external lightbox plugin, which works great, except the share option is broken and they seem to have gone bust. 🙁

    What I was after anyway, was an option to share before the lightbox, a button underneath the images etc. I tried the mpp social share plugin, but that is just sharing the main site URL.

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24863

    On further checking the mpp social sharing plugin, is sharing the correct url but it has no image to share, so it uses the default sharing image. If you’re going to share a gallery it would be far better to share using an image from the gallery, not some random default image. Seems to be a feature needed really. If there are other options to share single images, or galleries properly, could someone let me know?

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #24864

    Hello Audiomonk,

    Please try the latest plugin I have made some changes to it and let me know.

    https://github.com/mediapress/mpp-social-share/archive/master.zip

    Regards
    Ravi

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24877

    Hi,

    Thanks for your reply, and the latest changes, it certainly works better now and it does share the right URL and items, but the open graph data isn’t there, as a result it only shows a default image (not the mediapress one) and a default description/title. Would be much better if it could show the actual image being shared, or one from a gallery being shared, along with the title/description of the image or gallery.

    Is there any way to do this ?

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24878
    <meta property="og:image" content=
    "https://path.to/mediapress/image.jpg" />' 
    
    (whatever the link to the image would be) 
    
    and 
    
    

    <meta property=”og:title” content=”name of media” />
    <meta property=”og:description” content=”description of media if added etc” />`

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24883

    Hi Audiomonk,
    Did you try debugging the url?
    I am sure, we add the og meta properly.

    Here is the example

    https://github.com/mediapress/mpp-social-share/blob/master/core/class-mppss-hooks-helper.php#L169

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24912

    I did debug the URL, and you’re right it does show the meta, I use a browser extension that shows the meta for a page, and it points to the right image, and the right url with proper description. However, when I share that on facebook, it still puts a default description and a default image 🙁

    At first I thought it was my SEO plugin as that outputs og meta, so I disabled that, and the problem persists. Kind of driving me crazy how the page source shows the correct meta, but facebook (even on a non cached page) still shows default images.

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24915

    After a lot of debugging, I think the problem lies in the fact the URL passed to facebook is correct but the canonical URL is set to the homepage.

    So when the fetched URL matches the canonical URL everything works (this is on my regular posts with featured images).

    For some reason though the URLs for the galleries, and the media images in Mediapress, the fetched url and the canonical are different, the canonical being set to the homepage. So am guessing facebook goes there for the info. How can I fix that? Or any idea why it’s doing that ?

  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #24928

    Hi Audiomonk,
    That could be a possible reason. Please allow us to check tomorrow and get back to you.

    The strange part is, It worked for us. Which SEO plugin are you using? May be we will need to add a filter to generate proper canonical link for it.

    Thank you
    Brajesh

  • Participant
    Level: Master
    Posts: 163
    Audiomonk on #24940

    Ok Brajesh, and thanks for all your help.

    The SEO plugin I’m using is The SEO framework

    https://wordpress.org/plugins/autodescription/

    No idea why the two links aren’t matching, are they matching on yours? I could test a fix to see if that works if you have a quick solution and let you know? I don’t really understand canonical, I just know it works when the two links match and it doesn’t when they don’t.

    Thanks again.

You must be logged in to reply to this topic.

This topic is: not resolved