效果见博客右下角的tweet me!链接,方便访问者将博客发送到twitter。发送后的博客链接为经过yourls处理过的短链接。

打开并编辑Yourls: wordpress to twitter插件,增加函数,代码如下:

function myUrlShort()
{
global $id;
$short = wp_ozh_yourls_geturl( $id );
if ($short) echo $short;
}

在要放置tweet me!链接的地方放置如下代码:

<a target=”_blank” title=”Share this article with your Twitter followers” href=”http://twitter.com/home?status=Reading%3A+<?php the_title(); ?> – <?php $turl = myUrlShort();?> (via @LiJie)” rel=”nofollow”>Tweet me!</a>

这样就实现了tweet me的功能。点击链接后的效果如下:

参考

Home

No Comments Now!

Be the first to comment on this entry.

Leave a comment

Name(required)
Mail (required),(will not be published)
Website(recommended)

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://lijie.org),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes