vanoccupanther1
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Fixing WordPress
In reply to: How to make Gravatar image a link to author’s page?Well, I gave it a whirl and I couldn’t get it to work. Here’s my code:
In functions.phpfunction get_the_avatars_with_link_to_authors(){ $authors = get_users_of_blog(); foreach ($authors as $author){ $author_data = get_userdata($author->user_id); $author_nicename = $author_data->user_nicename; $author_displayname = $author_data->display_name; $link .= '<li style="list-style-type:none;list-style-position: outside"><a style="text-decoration:none;" href="' . get_author_posts_url($author_data->ID) . '" title="' . sprintf( __( "View %s's profile" ), $author_displayname ) . '">' . get_avatar($author_data->ID,$size = '35') . $author_displayname . '</a></li>'; } return $link; }and in my sidebar I have:
<?php printf( __( '%s', 'libra' ), get_the_avatars_with_link_to_authors() ) ?>Forum: Fixing WordPress
In reply to: How to make Gravatar image a link to author’s page?Thanks esml – I’ll give that a try and let you know how I get on 😉
Forum: Fixing WordPress
In reply to: How to make Gravatar image a link to author’s page?Hi guys!
@ astracan I got this to work perfect but do you know how I can hide the administrator’s avatar/link from showing in the sidebar? I only need to show authors and not the admin.
Cheers! 🙂
Viewing 3 replies - 1 through 3 (of 3 total)