2014-02-13 39 views
0

我想在单个页面上显示作者的twitter,它说“作者”。wordpress显示作者推特

这里是我目前正在使用:

By <?php the_author_posts_link(); ?> (<?php if (get_the_author_meta('twitter')) : ?> 
<a href="<?php the_author_meta('twitter');?>" target="_blank">Follow On Twitter</a> 
<?php endif; ?>) 

我只是想改变“在Twitter上关注”位表明用户@twitterusername,链接可与要去的Twitter页面,只是将喜欢它显示该用户名?

例子:worldinsport.com/froch-vs-groves-ii-agreed

问候

回答

0

试试这个,你可以使用<?php the_author_meta('user_email'); ?>获得Twitter的用户标识

By <?php the_author_posts_link(); ?> (<?php if (get_the_author_meta('twitter')) : ?> 
    <a href="<?php the_author_meta('twitter');?>" target="_blank"> 
     Follow On Twitter <?php the_author_meta('user_email'); ?> 
    </a> 
<?php endif; ?>) 

编号:http://codex.wordpress.org/Function_Reference/the_author_meta

+0

嗨,那只是显示用户的电子邮件地址,我希望它显示用户的Twitter用户名? – Neil

+0

完成它,使用:<?php the_author_meta('wp-to-twitter-user-username'); ?>,但需要安装wptotwitter插件。 – Neil