Jump to content

Change FB sharer button so it displays count?


LDDG

Recommended Posts

Posted

How can I change this FB share button:

Capture.JPG

 

so that it shows a FB share button with counter such as this one?

Capture.JPG

 

I copy the code FB provides for this share/counter button and pasted into the correct template but even though the button showed up without a problem, the link it was providing was incorrect.

Posted
Just now, opentype said:

Not much to go on. What is the incorrect link? Which code did you use? Can we see a live URL where this is happening?

Yes, give me a min...

Posted

Ok,

Here is the current FB share button:

default_fb.PNG

When hovering over this FB button, I get the following WORKING CORRECTLY link:

https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.losdurosdelgenero.com%2Finicio%2Fentrevista-exclusiva-a-%C3%B1engo-flow-de-noti-under-r4266%2F

The above working link is produced by the core/front/sharelinks/facebook template,  which contains the following:

<a href="https://www.facebook.com/sharer/sharer.php?u={$url}" class="cShareLink cShareLink_facebook" target="_blank" data-role="shareLink" title='{lang="facebook_text"}' data-ipsTooltip>
	<i class="fa fa-facebook"></i>
</a>

 

 

Ok, now when I change the code in the core/front/sharelinks/facebook template with the code from Facebook to look like this:

<div class="fb-share-button" data-href="https://www.facebook.com/sharer/sharer.php?u={$url}" data-layout="button_count"></div>

 

I do get the correct button as seen here:

new_fb.PNG

The above FB share button with counter gives me the following URL:

https://www.facebook.com/sharer/sharer.php?app_id=1708992449339832&sdk=joey&u=https%3A%2F%2Fwww.facebook.com%2Fsharer%2Fsharer.php%3Fu%3Dhttp%253A%252F%252Fwww.losdurosdelgenero.com%252Finicio%252Fentrevista-exclusiva-a-%25C3%25B1engo-flow-de-noti-under-r4266%252F&display=popup&ref=plugin&src=share_button

This code does not work correctly as it does not pass the article's information correctly to Facebook.

This is what I get with this new code:

result.PNG

 

The website can be viewed at www.losdurosdelgenero.com and I used the very first article as an example.

Thanks for any help!

Posted
3 hours ago, opentype said:

Not much to go on. What is the incorrect link? Which code did you use? Can we see a live URL where this is happening?

I posted the info you asked for :thumbsup:

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...