3

How can I retrieve the permalink to a user (author) profile dynamically outside the loop by ID?

an alternative to the_author_link(), but for outside the loop.

Example:

get_author_link($user_id);
1

I believe the function you want is get_author_posts_url.

1
<a href=<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>">Author Name</a>
  • 5
    An explanation could change this code fragment into an answer. – fuxia Dec 22 '12 at 2:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.