Share buttons share homepage instead of actual page

本秂侑毒 提交于 2019-12-24 23:23:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!