-2

I am adding FB share button in my webpage and on click of share button I want to share share the image with some description. I followed this link https://developers.facebook.com/docs/plugins/share-button

even am able to share on FB but not able to pick the image and description .Its just accepting only the domain name.

Am not able to identify the issue...please guide me ..any help will be appreciated ,Thanks in advance

Meta Tag is not affecting at all...

  <meta property="og:url"           content="http://www.example.com/projectfoldername/aa.php" />
  <meta property="og:type"          content="website" />
  <meta property="og:title"         content="image Title" />
  <meta property="og:description"   content="image description" />
  <meta property="og:image"         content="http:///www.example.com/projectfoldername/imagefolder/image.jpg" />
</head>
<body>

  <!-- Load Facebook SDK for JavaScript -->
  <div id="fb-root"></div>
  <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));</script>

  <!-- Your share button code -->
  <div class="fb-share-button" 
    data-href="http://www.example.com/projectfoldername/aa.php" 
    data-layout="button_count">
  </div>

</body>
</html>

This warning am getting

Warnings That Should Be Fixed Inferred Property

The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.

Missing Properties The following required properties are missing: og:url, og:type, og:title, og:image, og:description, fb:app_id

error snapshot ...pls guide me

sudha
  • 1
  • 1
  • 5
  • What URL exactly are you sharing - that of an image directly? You should share the URL of an HTML document that contains the proper Open Graph meta data, see https://stackoverflow.com/questions/1138460 – CBroe Mar 14 '18 at 13:30
  • please check the code and guide me ...I have updated it with snapshot – sudha Mar 15 '18 at 06:19
  • If you need any more help on this, then please share a real example URL. – CBroe Mar 15 '18 at 07:42

1 Answers1

0

You would appear to be missing the Open Graph tags in your page head. Facebook uses these to scrape the page preview. If you look at the Full Code Example at the link in your post, you can see some sample tags.

If you specify the image and text in the OG tags, your sharer should work correctly.

sideroxylon
  • 4,338
  • 1
  • 22
  • 40