Viewing 2 replies - 1 through 2 (of 2 total)
  • query_posts('showposts=-1&author=123'); // for example, 123 as user ID.
    if(hace_posts()) :
      while(have_posts()) :
        the_post();
        /* do stuff */
      endwhile;
    endif;
    wp_reset_query();

    You can also use author_name=xxx if you prefer to use a name in place of ID.

    Also note: showposts is deprecated, and should be replaced with posts_per_page where appropriate.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get posts by user’ is closed to new replies.