Title: Pulling post by author
Last modified: August 19, 2016

---

# Pulling post by author

 *  [simplexunlocked](https://wordpress.org/support/users/simplexunlocked/)
 * (@simplexunlocked)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/)
 * I’m working on a new build for a webcomic i do, and rather than having a pool
   of the recent posts on the front page i was wondering if there was a line that
   i could to draw only the latest post from a specific user, and repeat this line
   with different parrameters to display up to 4 users this way on the main page.
   does anyone have a fix for this?
 * Asking here is a last resort i have been reading through docs for the last few
   hours with much angst. please and thank you.
 * -Simplexunlocked

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

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281079)
 * Use as needed:
 *     ```
       <?php
       //get all users, iterate through users, query for one post for the user, if there is a post then display posts title, author, content info
       $blogusers = get_users_of_blog();
       if ($blogusers) {
         foreach ($blogusers as $bloguser) {
           $args = array(
           'author' => $bloguser->user_id,
       	  'showposts' => 1,
       	  'caller_get_posts' => 1
           );
           $my_query = new WP_Query($args);
           if( $my_query->have_posts() ) {
             // $user = get_userdata($bloguser->user_id);
             // echo 'This is one post for author with User ID: ' . $user->ID . ' ' . $user->user_firstname . ' ' . $user->user_lastname;
             while ($my_query->have_posts()) : $my_query->the_post(); ?>
               <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
               <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?> </small>
               <?php
               the_content();
             endwhile;
           }
         }
       }
       ?>
       ```
   
 *  Thread Starter [simplexunlocked](https://wordpress.org/support/users/simplexunlocked/)
 * (@simplexunlocked)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281081)
 * Could perhaps explain which values are to be edited ^^;;; sorry this is a bit
   more advanced than what I’m used to. I’m not 100% fluent on php… yet….
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281117)
 * First of all, did you try the code? If you did, what is it that you would want
   changed?
 *  Thread Starter [simplexunlocked](https://wordpress.org/support/users/simplexunlocked/)
 * (@simplexunlocked)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281268)
 * okay i used it and for some reason it repeates the pull. for example, it pulls
   all my users posts and posts all the posts the same number of times as there 
   are users. i just want it to pull the most recent post from the users and post
   them once, and preferably on a way that i can controll what apears where on the
   page with divs and such.
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281269)
 * I just put that code before the loop using the WordPress Default theme’s wp-content/
   themes/default/index.php and it listed one post for each user.
 *  Thread Starter [simplexunlocked](https://wordpress.org/support/users/simplexunlocked/)
 * (@simplexunlocked)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281270)
 * Okay with the plugin I’m using to run my comic it calls for an altered loop to
   ignore a certain category, would this alter the results of that code?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281271)
 * Possibly. Switch to the WordPress Default theme, put that code just before the
   Put that code in the `<?php if (have_posts()) : ?>` in the wp-content/themes/
   default/index.php to see how it works.
 *  Thread Starter [simplexunlocked](https://wordpress.org/support/users/simplexunlocked/)
 * (@simplexunlocked)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281272)
 * Okay it seems to work right there, but i can’t seem to get it working right in
   the loop where i need it. Also there isn’t much to do to dictate what goes where.
   There isn’t amy specific tag i could use to pull a certain author?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281275)
 * > There isn’t amy specific tag i could use to pull a certain author?
 * Not that I know of.

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

The topic ‘Pulling post by author’ is closed to new replies.

## Tags

 * [author](https://wordpress.org/support/topic-tag/author/)
 * [code](https://wordpress.org/support/topic-tag/code/)
 * [line](https://wordpress.org/support/topic-tag/line/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [tag](https://wordpress.org/support/topic-tag/tag/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 9 replies
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/pulling-post-by-author/#post-1281275)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
