Support » Fixing WordPress » Display Authors Twitter

  • Hi all,

    I would like to display the authors twitter on the single page where it says By “Author”.

    I have tried this code unsuccessfully:
    By <?php the_author_posts_link(); ?><?php the_author_meta('twitter'); ?>

    Any help how I can achieve this please?

    Regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • C W (VYSO)

    (@cyril-washbrook)


    There is no default twitter user meta field, so this snippet does nothing on its own. How are you creating the twitter field?

    I have twitter fields on profile section for JM Twitter Cards and WP to twitter plugin.

    At present, I am using this:

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

    Example

    Ideally I would like the “Follow This Author Twitter” to have the author’s @twitter username displayed.

    Anyone know how?

    If you’re adding the author’s Twitter handle to the user accounts using WP to Twitter’s capabilities for that, it’s stored in an author meta field named ‘wp-to-twitter-user-username’.

    I already use wp-twitter, just would like to display on the article page the users twitter address who published the article.

    Example: By “Author” (@twitterusername)

    Here’s how I got it now:

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

    I would just like to change the “Follow on Twitter” bit to show that users @twitterusername, the link works with going to the twitter page, just would like it display that username?

    Regards

    Just re-read your post Joe, worked a treat.

    <?php the_author_meta( 'wp-to-twitter-user-username' ); ?>

    Cool. Glad you got it handled!

    Hi Joe,

    Ive recently run into some problems using that <?php the_author_meta( 'wp-to-twitter-user-username' ); ?>

    The full code I am using is: `<?php if ( get_the_author_meta( ‘wp-to-twitter-user-username’ ) ) : ?>
    (<a href=”<?php the_author_meta(‘twitter’ );?>” target=”_blank”>@<?php the_author_meta( ‘wp-to-twitter-user-username’ ); ?></a>)`

    However it doesn’t seem be working right.

    I have two examples here:

    http://worldinsport.com/chris-tremlett-kevin-pietersen-was-just-voicing-his-opinion/ – works on here

    http://worldinsport.com/west-ham-united-v-manchester-united-match-review/ – but doesn’t on here.

    Why would this be, for both user profiles I have a username on the WP Tweets User Settings on the edit profile page.

    I’m baffled about this one, any help please?

    Regards

    Problem solved, I somehow removed the // Add Twitter
    $contactmethods[‘twitter’] = ‘Twitter’;

    All done.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Display Authors Twitter’ is closed to new replies.