Title: Cant pass Author ID using variable
Last modified: August 21, 2016

---

# Cant pass Author ID using variable

 *  [leebaz](https://wordpress.org/support/users/leebaz/)
 * (@leebaz)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/cant-pass-author-id-using-variable/)
 * Hi,
    I’m trying to get more posts from the current author for single.php to output
   thumbnails from their other posts. If I pass the number directly it works, but
   if I put the ID in a vairablea and put the variable into the args it stops working.
   Any
 *     ```
       <?php
         $curUserID = the_author_meta('ID');
         echo $curUserID;
        $argsmore = array('post_type' => 'base_project', 'author' => $curUserID);
         $more_query = new WP_Query( $argsmore );
   
         // The Loop
         if ( $more_query->have_posts() ) :
         while ( $more_query->have_posts() ) : $more_query->the_post();
           the_title();
         endwhile;
         endif;
   
         // Reset Post Data
         wp_reset_postdata();
   
         ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [leebaz](https://wordpress.org/support/users/leebaz/)
 * (@leebaz)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/cant-pass-author-id-using-variable/#post-4671917)
 * It’s ok, I’ve done it. I had to use ‘get_the_author_meta’

Viewing 1 replies (of 1 total)

The topic ‘Cant pass Author ID using variable’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [leebaz](https://wordpress.org/support/users/leebaz/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/cant-pass-author-id-using-variable/#post-4671917)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
