0

I am working on a site where posts are made and I'd like to give visitors the ability to "share" a particular post that they link on their timeline. I have never done any social media integration, but I followed the instructions here and am still having problems. It's easier to show you than try to explain it. Go to http://www.badcustomerbureau.com/ and click on any of the Share links at the top of any post. Instead of sharing the post you clicked on, it tries to share a generic post with the same photo every time (photo of a dog). I used the code generator on the FB help site and it still has this issue. Please help!

ftbadolato
  • 23
  • 6

1 Answers1

0

The problem is in your meta tags. if you want your users to share any post to their timelines,then u have to give proper meta tags for each post.for eg: you have to pass the image name,title and description of particular post

<meta property="og:title" content="Worlds Worst Customer" />
<meta property="og:image" content="http://www.badcustomerbureau.com/uploads/evidence/62.JPG" />

OR

You can also call a javascript function onclick of your share button.like

<button type="submit" title="Share" onclick="Javascript:fbSharing('https://www.facebook.com/sharer/sharer.php?u=" + post_url + "');>

and add javascript function to your page

<script>
    function fbSharing(post_url) {
        var url = new String(post_url);
        window.open(post_url , "share_dialog", "width=500,height=300");
    }
    </script>
R C
  • 461
  • 4
  • 17
  • Given there are multiple Share buttons on the screen, I think I have to go the JavaScript route, correct?...given I can't have multiple meta tags... – ftbadolato Apr 16 '16 at 14:13
  • Well, I tried the JavaScript solution and am still seeing the same behavior. This is really weird. Any other thoughts? – ftbadolato Apr 17 '16 at 01:49
  • Does anyone have a clue how to do this? – ftbadolato Apr 17 '16 at 19:57
  • @ftbadolato It is not working because u have same meta tags on your post.aspx page and home page . You have to add dynamic meta tags in your (post.aspx) page, then javascript solution will work properly. – R C Apr 18 '16 at 04:20
  • OK...I thought it was the meta tag solution OR the JavaScript solution (per your original response). It sounds like both are needed though... – ftbadolato Apr 18 '16 at 16:50
  • Do I only need the 2 meta tags you mentioned originally? – ftbadolato Apr 18 '16 at 18:09
  • @ftbadolato no you have to include all these metatags :- – R C Apr 19 '16 at 04:43
  • OK...added the dynamic meta tags to post.aspx...still same behavior. I don't understand what I could be doing wrong at this point? – ftbadolato Apr 23 '16 at 03:51
  • @ftbadolato It started working for your post.aspx page.have u checked?....i think u have to go though this [link](http://stackoverflow.com/questions/16463030/how-to-add-facebook-share-button-on-my-website) – R C Apr 25 '16 at 06:05
  • No...it hasn't started working. To see for yourself, simply go to http://www.badcustomerbureau.com/. All of the share links show the same number of "shares" (4). When you click one, it does not try to share the correct article, and they all try to share the same article. – ftbadolato Apr 27 '16 at 03:23