Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to display, via a PHP function, the author posts link (myblog.com/author/jason) of the current logged in user ?

In fact, I would like to display, for every logged in user, a "My personnal page" link which links toward his author page.

Thanks !

share|improve this question

migrated from stackoverflow.com Jul 7 '11 at 6:21

This question came from our site for professional and enthusiast programmers.

2 Answers 2

Try this :

<a href="<?php echo home_url() . '/author/' . get_the_author_meta( 'user_login', wp_get_current_user()->ID ); ?>" >My personal page</a>
share|improve this answer
    
It works !!! Thank you so much ! –  Job78 Jul 7 '11 at 13:48
    
Be sure to mark as the accepted answer. Also: bloginfo() does not need to be echoed; it prints its output; also, I would recommend using echo home_url(); rather than bloginfo(). –  Chip Bennett Jul 7 '11 at 14:46
1  
@Chip Bennett, thanks, I updated the code. –  mike23 Jul 7 '11 at 15:13
<?php 
global $current_user;
get_currentuserinfo();
echo get_author_posts_url($current_user->ID); 
?>
share|improve this answer

protected by toscho yesterday

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?