i would like to know how to use a custom URL with ShareThis social share plugin. for a example i have a post summery on my index.php page taht is linking to my-post.php so what i want to do is to make users share my-post.php from my index page.
here is the code from sharethis.com
Buttons:
<span class='st_facebook_hcount' displayText='Facebook'></span>
<span class='st_twitter_hcount' displayText='Tweet'></span>
<span class='st_googleplus_hcount' displayText='Google +'></span>
<span class='st_pinterest_hcount' displayText='Pinterest'></span>
JS:
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "ur-448a73fe-e6c1-f7a5-f0a5-3912c860fc9e"});</script>
It offers free website tools and plugins for online content creators. ShareThis collects data on user behavior, and provides this to advertisers and technology companies for ad targeting, analytics, and customer acquisition purposes.
SHAREit is a cross platform sharing tool which requires no mobile data. It's over 200 times faster than Bluetooth. Share the photos, videos, audios and files of any formats with your friends at any time on your phone or computer. No need for a Wi-Fi network or a mobile data plan.
You can append a st_url property to each of your span tags which will control the URL that is shared.
<span class='st_facebook_hcount' st_url='http://my.custom.com/url' displayText='Facebook'></span>
Source: https://support.sharethis.com/hc/en-us/articles/218441477-How-to-Customize-which-URL-Text-and-IMG-to-Share
Just use st_url attribute like this:
<span class="st_sharethis" st_url="http://www.yoursite.com/innerpage.php" st_title="inner page title" displayText="ShareThis"></span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With