WordPress.org

Support

Support » How-To and Troubleshooting » How to get most recent post title (and link) for specific author

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

  • Hi,
    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?

Viewing 1 replies (of 1 total)
  • 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"); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘How to get most recent post title (and link) for specific author’ is closed to new replies.
Skip to toolbar