Sorry for the newbie question; I’m having a heck of a time trying to get user photos to appear beside an author’s name in his/her byline.
I installed the User Photo plugin, and am using Twenty Eleven with WP 3.3.1. I saw the documentation that says I have to do a bunch of PHP hand coding after installing the plugin. Um…okay, but which FILES do I add the php codes to so that author thumbnails appear beside their names?
Thanks in advance,
I am using the plugin user-avatar I think it is better.
and to make the avatars appear beside the names You can use the function
In which files ? to display it beside by (name), you need to make a change in the post footer in the file (content-single.php) in the $utility_text values.
open content-single.php file of twentyeleven theme and find this text:
replace it with:
Then find, this part :
printf( $utility_text, $categories_list, $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ), get_the_author(), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) );
replace it with:
printf( $utility_text, $categories_list, $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ), get_the_author(), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 20) ) );
Note: this change in the $utility_text values may affect translation of this part of the theme if it isn’t in English.
Thanks for the reply, Dawn; sorry it’s taken a few days for me to get back on this project.
I installed the plugin you suggested and made the code changes. No errors have cropped up, but the avatar is still not appearing on blog posts.
get_avatar ( get_author_meta ( 'user_email')...function, I tried swapping the ‘user_email’ argument with ‘ID’, and it made no difference – I thought the function might just not be finding the author’s meta-data.
I do like the intuitive way the plugin allows me to add an author photo. I’m just not able to get this image to print to screen on posts.
Thanks again for your help.
Please disregard previous; the user photo DOES appear beside the author’s name BELOW the article. I just need to find the place at the TOP of the article to add the
Thank you again for all your help!
I was having the same issue as the OP, not knowing which files I had to edit. This was the closest I got to an answer that would solve my newbie problem, however it didn’t work.
I did the exact same thing as Dawn suggested – same plugin, same modifications on the same page.
blog at http://honestaciadeteatro.com.br/wp (not in english, sorry)
- The topic ‘User Photo with Twenty Eleven’ is closed to new replies.