Title: How do I hyperlink a get_user_meta function.
Last modified: August 30, 2016

---

# How do I hyperlink a get_user_meta function.

 *  Resolved [theiATown](https://wordpress.org/support/users/theiatown/)
 * (@theiatown)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-hyperlink-a-get_user_meta-function/)
 * Hello,
 * I am using the get_user_meta(‘$field’, ‘user_Id ‘) which retrieves information
   from a user profile and display its. What I am trying to do is turn this into
   a link. I have tried to use the “a href” approach, however it didn’t work.
 * So for example, I have a user custom field called “state”. When I plug that into
   the get_user_meta(‘state’, ‘user_id’), the output for one user would be California.
   While the outlook for user 2 would be Ohio. I created two different pages for
   these “states” and I want the state to be a hyperlink directing to different 
   pages based on the output name (e.g California).
 * I also want to route to a subdomain(e.g. California.site.com) and NOT a site.
   com/Califonia.php page. Can someone please help.
 * Thank you

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

 *  [Tyler Shadick](https://wordpress.org/support/users/tyler-shadick/)
 * (@tyler-shadick)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-hyperlink-a-get_user_meta-function/#post-6698422)
 * The syntax is
    `<?php get_user_meta($user_id, $key, $single); ?>`
 * Just checking, you’re not describing the right order of parameters in your post:
 *     ```
       $user_id = whateverID; //use some function to grab the current userID that you're looking for
       $user_url = get_user_meta($user_id, 'user_url');
       $user_name = get_user_meta($user_id, 'display_name');
       $user_state = get_user_meta($user_id, 'state');
   
       <a href="<?php echo $user_url; ?>"><?php echo $user_name; ?> from <?php echo $user_state;  ?></a>
       ```
   
 * *I have not tested this code, so user it as a guide and double check before implementing
 * Let me know if that helps!
 *  Thread Starter [theiATown](https://wordpress.org/support/users/theiatown/)
 * (@theiatown)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-hyperlink-a-get_user_meta-function/#post-6698490)
 * Thanks Tyler. I will give it a try, and let you know.
 *  Thread Starter [theiATown](https://wordpress.org/support/users/theiatown/)
 * (@theiatown)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-hyperlink-a-get_user_meta-function/#post-6698531)
 * I was able to get it to work. Thanks Tyler.

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

The topic ‘How do I hyperlink a get_user_meta function.’ is closed to new replies.

## Tags

 * [get_user_meta](https://wordpress.org/support/topic-tag/get_user_meta/)
 * [hyperlink](https://wordpress.org/support/topic-tag/hyperlink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [theiATown](https://wordpress.org/support/users/theiatown/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/how-do-i-hyperlink-a-get_user_meta-function/#post-6698531)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
