0

I would like to create custom authors links that lead to the page specified by the author. Instead of http://example.com/author/example for example http://facebook.com/authorexample.

How can I do that?

2
  • possible duplicate, this answer hope will help you to solve your problem.
    – Anjum
    Aug 21 '13 at 6:12
  • @Anjum is not a duplicate. Answer you linked is about author archive in wordpress. This question is about author url, the one that is filled in profile page in backend.
    – gmazzap
    Aug 21 '13 at 10:29
0

You can use author_link filter to change the author's link

add_filter( 'author_link', 'wpse110967_author_link', 10,2 ); 
function wpse110967_author_link( $link, $user_id ){

  //Retrieve authors url from user meta
  $_link = esc_url( get_user_meta( $user_id, 'wpse110967_author_link', true ) );

  if( $_link )
      $link = $_link;

  return $link;
}

In the above example its assumed that you've stored the author-specified url as user meta with the key wpse110967_author_link. If no url is found, it fallback to the default WordPress url.

0

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.