|
|
wordpress的程序上,点击按钮之后,把文章的摘要内容及文章的链接发到微博上,效果可以看文章下边的新浪分享按钮- <a href="javascript:void((function(s,d,e,r,l,p,t,z,c){var%20f='http://v.t.sina.com.cn/share/share.php?appkey=880398224',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&source=',e(r),'&sourceUrl=',e(l),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=440,height=430,left=',(s.width-440)/2,',top=',(s.height-430)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0,150,"...",'utf-8'); ?>','你的网址','页面编码gb2312|utf-8默认gb2312'));"> <img border="0" title="新浪微博分享" alt="新浪微博分享" src="http://t.sina.com.cn/favicon.ico" />分享</a>
复制代码 注意:1.此代码只能用在wordpress的程序上,若用在其他程序上,请根据情况修改<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0,150,"...",'utf-8'); ?>这个段代码
2.想让链接是本篇文章的链接的话,找到u=z||d.location 把他改成u=d.location
3.在你的网址的地方改成你的网站主页,然后把上边的代码复制到相应的位置就可以了 |
|