NewUser NewUser - 6 months ago 29
Javascript Question

Get Wordpress User Profile Url/Link by ID

I managed to show up the users Profile Images from the mainsite xxxxx.com/
in my bbpress forum xxxxxxxx.forum/ with this code:

<?php $user_info = get_user_by('id', $wp_query->query_vars['author']); echo get_avatar($user_info->ID, '150'); ?>


Question:

How can i get the Users Profile URL/LINK like xxxxxx.com/user/username with the same method?

Thank you so much!

Answer

This function should help: https://codex.wordpress.org/Template_Tags/the_author_meta the_author_meta( $field, $userID );

for profile link you'll need 'user_url' for the field