Asked 6 years ago
21 Mar 2018
Views 1060
jaggy

jaggy posted

share url on facebook does not show up the title and website url


<a class="facebook" target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=http://domain.com/blog-page-detail/">
				  <span class="fa fa-facebook"></span></a>



http://www.facebook.com/sharer/sharer.php?u=http://domain.com/blog-page-detail/


share url on facebook does not show up the title and website url , possible something wrong with configuration
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00


use of Sharer.php is not right way to put share button on the website . but you can use following code to make it work
put belowed code in the head tag

<meta property="og:url"           content="https://www.archirayan.com/facebook-integration-with-website" />
  <meta property="og:type"          content="website" />
  <meta property="og:title"         content="Archirayan infotech" />
  <meta property="og:description"   content="" />
  <meta property="og:image"         content=""http://archirayan.com/assets/images/logo-home.png" />


and try to put the code where you want to put facebook share button


<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="https://www.archirayan.com/facebook-integration-with-website" 
    data-layout="button_count">
  </div>


it should work like charm !!
Post Answer