Display latest post by author
-
Hello.
Currently I’m trying to display posts by the author’s id and according to query_post this code should work, could chance i’m missing something.
Can somebody help
get_header(); ?> <div> Latest News <ul> <?php $polly_current_author = the_author_meta('ID'); //testing purposes echo $polly_current_author; query_posts("cat=3&author=$polly_current_author"); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"> <?php the_title(); ?></a> </li> <?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?> <!-- End Loop --> </ul> </div> <?php get_footer(); ?>
thanks
- The topic ‘Display latest post by author’ is closed to new replies.