• Resolved slurve

    (@slurve)


    Anyone know how I would go about displaying meta data (like a Twitter name) after each author name? The meta data is already set up. Expected output would be:

    By Author1 (@twitter1) and Author2 (@twitter2)

    Would I be able to do this with the coauthors_posts_links() function? I see parameters for before and after, but it seems to be before and after the entire output, not before/after each author.

    Any help would be appreciated. Thanks!

    http://wordpress.org/extend/plugins/co-authors-plus/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Have you tried writing a loop and generating your own byline output?

    Alternatively, you should be able to filter ‘coauthors_posts_link’ to add the Twitter username. Here’s some untested pseudo-code:

    add_filter( 'coauthors_posts_link', 'capx_filter_coauthors_posts_link', 10, 2 );
    function capx_filter_coauthors_posts_link( $args, $author ) {
    
    	$twitter = get_user_meta( $author->ID, 'twitter', true );
    	if ( $twitter )
    		$args['text'] .= '@' . $twitter;
    
    	return $args;
    }
    Thread Starter slurve

    (@slurve)

    This worked like a champ. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying meta data from user profile page’ is closed to new replies.