Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i add a custom facebook icon for facebook share button?

Can i add a custom facebook icon for facebook share button??

following is code i tried but i could't replace default logo with a custom icon

<div class="fb-share-button"
  data-href="<?php echo SITE_URL;?>product/<?php echo $this->uri->segment(2);?>"  
  data-layout="link"></div>
like image 385
Viraj Kaulkar Avatar asked Feb 10 '23 10:02

Viraj Kaulkar


2 Answers

There is limited number of styles, that you can choose from using Facebook API. You can change "layout", not "icon". One of, and default, layout is "icon_link".

If you want to use your own style/image: Can I use the Share Dialog without using the Share Button?

Other simple, but primitive way to do this:

<a href="https://www.facebook.com/sharer/sharer.php?u=http://example.com">
    <img src="./youimage.png" alt="share icon">
    Link text
</a>
like image 80
Tymek Avatar answered Feb 13 '23 00:02

Tymek


This is what I've done.I used the information at this page: Make Your Own Social Media Sharing Buttons.But I couldn't achieve to open share dialog in a pop up window. In this page,in Martina's answer (Optional 2) I've found the solution.Thanks.I hope this syntesis will be helpfull to the people as an example.

<ul class="sharing-buttons">
  <li>
    <a class="fb-xfbml-parse-ignore" target="popup" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdengdeney.blogspot.com.tr%2F&amp;src=sdkpreparse','popup','width=600,height=500'); return false; " href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fdengdeney.blogspot.com.tr%2F&amp;src=sdkpreparse">
      <img src="
https://drive.google.com/uc?id=0B6hjXoGtqTbPRDN0cG9BVnozdEk" border="0" /></a>
  </li>
</ul>
like image 38
ibomi Avatar answered Feb 12 '23 22:02

ibomi