Sharing button picking the wrong url in webpage containing different news. How to correct it?

StackOverflow https://stackoverflow.com/questions/14680764

  •  06-03-2022
  •  | 
  •  

Question

In my website a webpage contains different news each links to different pages which has detail info. I put sharethis button under each news headings. But when I started sharing specific headline the current webpage where all the news headings are shown is shared. Is there any alteration needed to the dowloaded shathis button code? Can any one help me solve this problem please..

Was it helpful?

Solution

Here's how most share scripts work:

If you copy and paste their script, "as is", on to your webpage, they automatically detect and share the URL of the page that they exist on. This is why all your ShareThis buttons on the page are detecting and sharing the "current web page" as you put it.

This is what you need to do:

You need to specify the URL that each button should share inside each button's script. Their API has detailed documentation on this.

http://support.sharethis.com/customer/portal/articles/475079-share-properties-and-sharing-custom-information

Let me know if this helps.

OTHER TIPS

What are you talking about exactly? What kind of share button? Is this a Facebook plugin? If so then you need to dynamically insert the url. They give you code to place on your site where you want the button to appear, that is where you do it.

<div class="fb-like" data-href="<?php echo $url; ?>" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>

Sorry if this is of no use to you, I really am unclear what you are asking help with exactly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top