问题
For a client's blog I added social share buttons at the bottom each blogpage: http://www.pano-solutions.be/5-tips-voor-een-great-place-to-work.php
I use the sharethis plugin for this. However, when I click on any of the sharebuttons, It will share the mainpage of the website instead of the blogpage. Not very usefull. I searched the FAQ on sharethis, but didn't find any usefull help there.
Someone knows how I can fix this or know any working alternatives or good practises on how to do this myself?
回答1:
ShareThis has a tweak where you can add: expr:st_title='data:post.title' expr:st_url='data:post.url'
to each button, forcing the share buttons to share the link in the post instead of the link in the broswer.
The code would look something similar to this:
< span class='st_twitter_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
< span class='st_facebook_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
< span class='st_googleplus_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
< span class='st_linkedin_hcount' expr:st_title='data:post.title' expr:st_url='data:post.url'/>
来源:https://stackoverflow.com/questions/16714662/share-buttons-share-homepage-instead-of-actual-page