Skip to main content
1 of 3
brasofilo
  • 22.1k
  • 8
  • 69
  • 264

Another approach could be to use a function that loops through [get_posts][1] and prints the result.

Check this Q&A: When should you use WP_Query vs query_posts() vs get_posts()?

// function located in the theme's functions.php
function wpse_78117_print_authors_last_post() 
{
    $user_ids = array( '1', '2' );
    foreach( $user_ids as $user )
    {
        $args = array( 
                'post_type'     => 'post',
                'numberposts'   => 1,
                'author'        => $user
            ); 
        
        // as we are getting only 1 post, extract it from the returned array
        $user_post = array_shift( get_posts( $args ) );
        
        // similar
        $nick = array_shift( get_user_meta( $user, 'nickname' ) );

        // custom output, $user_post contains all the post normal data
        echo $user_post->post_title . ', by: ' . $nick;
    }
}

And then use it in any theme template:
<?php wpse_78117_print_authors_last_post(); ?>. [1]: http://codex.wordpress.org/Template_Tags/get_posts

brasofilo
  • 22.1k
  • 8
  • 69
  • 264