• Welcome to Rotar E@rth!
  • Feel free to look around and comment~
  • Tin - for a better fantasy life!
  • TinTimer - for an even better fantasy life!

修改代码添加文章SNS分享链接| Code for adding bookmark links to popular SNS for each post

Blog Rotar 552 Views 0 Comment

之前说到可以用WP Greeting Box来识别来客来源网站,这次则是截然相反的代码。作用便是鼓励读者将文章推荐到各大社交网站进行分享。起初我是用的”Simple Social Network Bookmark”这个插件的,结果在目前的主题上出现了错误,使得侧边栏被移动到了最下方。于是无奈只好自己动手修改代码。已有的这个插件颇有些借鉴价值,于是俺就将其中的分享链接部分提取了出来,却不知道该放在哪里。经过一番股沟搜查,发现主题目录下的single.php是关键,于是在tag之后添加了如下代码:

————————–Lang Sep————————-

The code below adds the ability of bookmarking the current post to popular Social Network Sites(SNS) to the blog. You can put it in to the single.php file in the directory of your theme. The code was originated in a plugin called ”Simple Social Network Bookmark”. However, this plugin had some collision with my theme so I rewrote it and the effect is shown after this article. The path of the images may vary for different image sources.

Code:

其中人人网是后期添加的,道理是一样的。


Like (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址