本站已添加的收藏分享代码

写自 by Licream

标签: wordpress, 网络相关

最近对主题的改动相当多,想总结一下,但涉及的内容比较多,恐怕一次性写完的长篇大论怕难看完额,所以分段分享,这样标题也明确。呵呵,
我对PHP技术不懂写不出什么代码出来,基本我使用的方法都来自于网络及各大博客里技术文章阿,无奈的我只会copy。发此贴第一为了分享,二为了收藏以作备用- -。
直接上代码了。
首先把下面的代码复制到single.php文件自已主题的相应文置,我放在标签下面。(我的标签已经放在标题上面去了)。

 <p class="follow">
原文链接 :<a href="<?php the_permalink() ?>">< ?php the_permalink() ?></a><br />
转载原创文章请注明来源:<a href="<?php bloginfo('url');?>" target="_blank"> < ?php bloginfo('name');?></a><br />
订阅本博:<a href="http://www.licream.net/feed">RSS订阅</a> ( <a href="http://fusion.google.com/add?feedurl=http://www.licream.net/feed/">Google Reader</a>
 / <a href="http://reader.youdao.com/#url=http://www.licream.net/feed/">有道</a>
 / <a href="http://mail.qq.com/cgi-bin/feed?u=http://www.licream.net/feed/">QQ邮箱</a>
 / <a href="http://www.xianguo.com/subscribe.php?url=http://www.licream.net/feed/">鲜果</a>
 / <a href="http://9.douban.com/reader/subscribe?url=http://www.licream.net/feed/">豆瓣</a>
 / <a href="http://www.zhuaxia.com/add_channel.php?url=http://www.licream.net/feed/">抓虾</a>)<br />
收藏分享本文:<a title="转贴到校内人人网" href="javascript:void((function(s,d,e){if(/xiaonei\.com/.test(d.location))return;var%20f='http://share.xiaonei.com/share/buttonshare.do?link=',u=d.location,l=d.title,p=[e(u),'&amp;title=',e(l)].join('');function%20a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent));"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/renren.gif" alt="分享到校内人人网" border="0" height="16" width="16"/></a>

<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(kaixin=window.open('http://www.kaixin001.com/~repaste/repaste.php?&amp;rurl='+escape(d.location.href)+'&amp;rtitle='+escape(d.title)+'&amp;rcontent='+escape(d.title),'kaixin'));kaixin.focus();" title="转贴到开心网"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/kaixin.gif" alt="转贴到开心网" border="0"/></a>

<a title="添加到QQ书签" href="javascript:window.open('http://shuqian.qq.com/post?from=3&amp;title='+encodeURIComponent(document.title)+'&amp;uri='+encodeURIComponent(document.location.href)+'&amp;jumpback=2&amp;noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/qq.png" alt="QQ书签" border="0" height="16" width="16"/></a>

<a href="http://app.foxling.cn/dilink/share.asp?u=<?php the_permalink(); ?>&t=< ?php the_title(); ?>" title="嘀咕一下" target="_blank"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/digu.png"/></a>

<a href="javascript:u=location.href;t=document.title;t=t.substr(0,76);c=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,180);location=%22http://zuosa.com/collect/Collect.aspx?t=%22+encodeURIComponent(t)+%22&u=%22+encodeURIComponent(u);void%200" title="你在做啥"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/zuosa.gif"/></a>

<a title="添加到百度搜藏" href="javascript:u=location.href;t=document.title;t=t.substr(0,76);c=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);c=c.substr(0,180);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&amp;iu=%22+encodeURIComponent(u)+%22&amp;dc=%22+encodeURIComponent(c)+%22&amp;fr=ien#nw=1%22;window.open(url,'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');void 0"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/baidu.gif" alt="百度搜藏" border="0" height="16" width="16"/></a>

<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&amp;title='+escape(d.title)+'&amp;url='+escape(d.location.href)+'&amp;desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));vivi.focus();" title="收藏到新浪ViVi"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/vivi.gif" alt="Sina ViVi" border="0"/></a>

<a title="收藏到Google书签" href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open('http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk='+c(b.location)+'&amp;title='+c(b.title),'bkmk_popup','left='+((a.screenX||a.screenLeft)+10)+',top='+((a.screenY||a.screenTop)+10)+',height=420px,width=550px,resizable=1,alwaysRaised=1');a.setTimeout(function(){d.focus()},300)})();"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/googlebookmark.png" alt="Google书签" border="0" height="16" width="16"/></a>

<a title="添加到雅虎收藏" onclick="window.open('http://myweb.cn.yahoo.com/popadd.html?url='+encodeURIComponent(document.location.href)+'&amp;title='+encodeURIComponent(document.title), 'Yahoo','scrollbars=yes,width=440,height=440,left=80,top=80,status=yes,resizable=yes');" href="javascript:;" rel="nofollow"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/yahoo.gif" alt="yahoo收藏" border="0" height="16" width="16"/></a>

<a title="保存到del.icio.us美味书签" href="javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&amp;title='+encodeURIComponent(document.title)+'&amp;v=5&amp;';a=function(){if(!window.open(f+'noui=1&amp;jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/delicious.gif" alt="Del.icio.us" border="0" height="16" width="16"/></a>

<a title="推荐到digg.com" href="javascript:location.href='http://digg.com/submit?phase=2&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/digg.gif" alt="digg" border="0"/></a>

<a href="javascript:void(location.href='https://twitter.com/home?status=Now%20reading%20<<'+encodeURIComponent(document.title)+'>>%20'+encodeURIComponent(location.href))" title="分享到 Twitter"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/twitter.png" alt="分享到twitter"/></a>

 <a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/365key.gif" title="收藏到365Key" /></a> 

 <a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(yesky=window.open('http://hot.yesky.com/dp.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&st=2','yesky','scrollbars=no,width=400,height=480,left=75,top=20,status=no,resizable=yes'));yesky.focus();"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/yesky.gif"  title="收藏到天极" /></a> 

<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://my.poco.cn/fav/storeIt.php?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&img=http://www.h-strong.com/blog/logo.gif','keyit','scrollbars=no,width=475,height=575,status=no,resizable=yes'));keyit.focus();"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/poco.gif"  title="收藏到POCO"/></a> 

<a href="javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'');void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes'));"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/hexun.gif"  title="收藏到和迅" /></a> 

<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(blog=window.open('http://www.bolaa.com/CommendBlog/SmallLogin.aspx?title='+escape(d.title)+'&newspath='+escape(d.location.href)+'&subtitle='+escape(t),'bolaa','width=400px,height=400px'));blog.focus();"><img src="http://www.licream.net/wp-content/themes/istudio-theme/resources/bolaa.gif"  title="收藏到博拉" /></a> </p>

再到style.css添加一段样式代码:

.follow{background:#dbf3fd;border:1px #dcddd6;font-size:11px;width:600px;margin:10px 15px;padding:10px;}

可以说也省了一个插件哈,样式代码我copy “zww”的,HOHO。添加这个是不是觉得增加互动性呢,如果你也是爱折腾的,想减少插件想法,这个非常适合你啊。哈哈

40条评论 请留下你最想说的:)

  1. ChandlerKENDRA34 POLAND Internet Explorer Windows 说到:

    If you are willing to buy a car, you will have to get the loan. Moreover, my brother always utilizes a auto loan, which supposes to be the most rapid.

  2. Aviva UNITED STATES Mozilla Firefox Windows 说到:

    很好,正要用呢

  3. 网络推广 CHINA Internet Explorer Windows 说到:

    我博客也都弄上了。谢谢分享

  4. 网络推广 CHINA Internet Explorer Windows 说到:

    我昨天一直在修改风格,可给我累毁了。我也准备加个这个,不过最好能实现js调用。

  5. 网络推广 CHINA Internet Explorer Windows 说到:

    这个不错,支持!我研究研究

  6. Jutoy CHINA Google Chrome Windows 说到:

    代码高亮暂时还用不到,我很少写技术文章…

  7. 一路同行 CHINA Internet Explorer Windows 说到:

    这个高亮插件怎么没有滚动条,这样会影响布局

  8. 三七八蛋 CHINA Mozilla Firefox Windows 说到:

    不错,估计比addthis那个快一点?

  9. Junan CHINA Internet Explorer Windows 说到:

    哈哈~~你的代码太长了~~右边错位了~ :mrgreen: ~~WP好像有个这样的插件~

  10. diyidu CHINA Internet Explorer Windows 说到:

    不错,支持一下.

  11. 先看看 CHINA Internet Explorer Windows 说到:

    好久都没有用过这个代码了

  12. ajulee CHINA Internet Explorer Windows 说到:

    :!: 不错 一会儿也加上

  13. 一路同行 CHINA Internet Explorer Windows 说到:

    后面的代码看不见啊,高亮插件还没搞定么

  14. 万戈 CHINA Mozilla Firefox Windows 说到:

    恩,是个很好的用户体验,不错的

  15. SEO培训 CHINA Internet Explorer 说到:

    博主用的是什么模板啊?真好看,支持你

  16. 卢松松 CHINA Mozilla Firefox Windows 说到:

    那如果改成自己的代码 应该怎么写呢?突出以下 我们应该修改那里

  17. 一路同行 CHINA Internet Explorer Windows 说到:

    这个东东貌似不错,很多博客文章都有,我去弄弄看 :smile:

  18. 回忆 CHINA Mozilla Firefox Windows 说到:

    有时间我也添加一下看看 :oops:

  19. licream CHINA Google Chrome Windows 说到:

    …郁闷,不知道为什么高亮插件失效了。 :?:

留下评论哦 Here's Your Chance to Be Heard!