On the single post page I want to link the avatar function to the author profile, but I tried
<a href="<?php the_author_posts_link(); ?>">
<img src="<?php echo get_avatar($post->post_author, '64', $avatar); ?>">
</a>
but that doesn't work.
Also, how can I display the nickname (display name) and still link to the profile the following code gives a strange link and 404s
<a href="<?php echo get_author_posts_url(); ?>"><?php the_author_nickname(); ?></a>
some help would be greatly appreciated. Thanks
the_author_posts_link()
is a deprecated function since version 2.1, useget_author_posts_url()
instead codex.wordpress.org/Function_Reference/get_author_posts_url; Second, make sure the code is not wrapped in a conditional<?php if ( get_the_author_meta( 'description' ) ) :
and your description is not filled; other conditions may apply, check your code and make sure the requirements are met. This is as far as I can go without knowing in what way is it not working? Errors? Please edit your question to be more specific. – soulseekah Oct 17 '11 at 3:36get_author_posts_url()
takes an argument that requires "ID of the author whose URL should be retrieved." codex.wordpress.org/Function_Reference/get_author_posts_url, that's the reason you're getting a 404, because the page "warning: Missing argument 1 for get_author_posts_url()" does not exist on your server, does it? :) – soulseekah Oct 17 '11 at 3:43get_author_posts_url( get_the_author_meta( 'ID' ) )
, let me know if you problem is solved so that I can compile an answer to this question. – soulseekah Oct 17 '11 at 3:57