Share your website link in Facebook,Google+ - Mostlikers

29 January, 2015

Share your website link in Facebook,Google+

Share your website link in social media website. Everyone want to share they website link to social media network. every time they will go social websites after only they post to timeline, Here i am written sharing code, Just click social media icons it will share automatically to your social media timeline. Previously i have posted Share links to social network sites with Your site topic but this one updated.

facebook sharing

Live Demo             Download


I have store some sharing data value in php variables.
  $name="Share links to social network sites with Yoursite";
  $caption="social sharing mostlikers";
  $description="This concept share web your page link to social medias."; 


Google+ i have shared url <?php echo $src;?>  - it will work offline.
Facebook  i have shared image,description,url,title - it will work online.
    <title>Share links | mostlikers</title>
    <tr><!--google+ sharing -->
        <a href="{<?php  echo $src;?>}"
         onclick=",'', 'menubar=no,
         toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
            <img width="200" src="google+.png"/>
      </td><!--/google+ sharing -->
      <td> <a  href="#" id="shareonfacebook"><img  src="facebook.jpg"></a></td>
      <td> <div class="fb-share-button"  data-href="<?php echo $src; ?>" 


Before using below script you need to create facebook app in your page 
Change App id (123APPID) to your App id
<script src="//"></script>          
 $(document).ready(function () {
 $('#shareonfacebook').click(function (e) {    
    var name ='<?php echo $name; ?>';
    var caption ='<?php echo $caption; ?>';
    var picture ='<?php echo $picture; ?>';
    var description ='<?php echo $description; ?>';
    var link ='<?php echo $src; ?>';     
           method: 'feed',
           name: name,
           link: link,
           caption: caption,
           picture: picture,
           description: description,
           message: ''
FB.init({appId: '123APPID', status: true, cookie: true,
xfbml: true});
     <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); = id;
  js.src = "//";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

I hope this post helpful for you. If you have any suggestion comment below.

No comments:

Post a Comment