2014-02-13 57 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