I'm wondering how could I achieve this result mixing the avatar image with href to author page and also when the mouse is over the image, show in "html title tag" the name of the user?

I know I can do this all alone, like using the get_avatar_url and using the get_avatar and get_the_author, like this below:

echo get_avatar( get_the_author_meta( 'ID' ), 32 ); 
$author = get_the_author(); echo $author;

How can I do this? I didn't understand how the apply_filter works in Wordpress, I know there is $alts where I could modify the HTML, but I don't know how (no examples in the web).

BTW: This is gonna be used in The Loops section.


My god :P

It was as simple as html tags, I just didn't know the correct wordpress functions to use.

Here it go, for future reference:

<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>">
<img src="<?php echo get_avatar_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php echo get_the_author(); ?>">
| improve this answer | |

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.