Title: Usermeta Data in the search.php loop
Last modified: August 21, 2016

---

# Usermeta Data in the search.php loop

 *  Resolved [theApe](https://wordpress.org/support/users/theape/)
 * (@theape)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/usermeta-data-in-the-searchphp-loop/)
 * How do I pull in the user meta data or the author meta in the **search.php** 
   template?
 * I have this at the moment in the loop…
 *     ```
       $user = get_userdata($post->post_author);
       the_author_meta( 'first_name',$user );
       ```
   
 * But it returns nothing. Any help would be greatly appreciated.
 * This wouldn’t work either.
    `the_author_meta('first_name');`

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

 *  Thread Starter [theApe](https://wordpress.org/support/users/theape/)
 * (@theape)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/usermeta-data-in-the-searchphp-loop/#post-4645420)
 * I’m using the search function to search custom post types if that makes any difference.
 *  Thread Starter [theApe](https://wordpress.org/support/users/theape/)
 * (@theape)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/usermeta-data-in-the-searchphp-loop/#post-4645435)
 * Marking this as solved as it was a stupid mistake, where I’d indexed the user
   profiles and they were being included with the search, hence the lack of user
   meta.

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

The topic ‘Usermeta Data in the search.php loop’ is closed to new replies.

## Tags

 * [author](https://wordpress.org/support/topic-tag/author/)
 * [user](https://wordpress.org/support/topic-tag/user/)

 * 2 replies
 * 1 participant
 * Last reply from: [theApe](https://wordpress.org/support/users/theape/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/usermeta-data-in-the-searchphp-loop/#post-4645435)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
