How to get most recent post title (and link) for specific author (2 posts)

  1. berchman
    Posted 6 years ago #

    I am attempting to retrieve the most recent post from a specific author.

    What I have is this:

    <?php wp_reset_query(); $temp_query = $wp_query; ?>
    	<?php query_posts("author=1&showposts=1"); ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    	<?php endwhile; ?>

    I know the author=1 is the Author ID.

    Why will this NOT return the most recent post?

  2. vtxyzzy
    Posted 6 years ago #

    Just a guess, but if you have sticky posts, that may be interfering. Give this a try:

    <?php query_posts("author=1&posts_per_page=1&caller_get_posts=1"); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic