WordPress: Display Author Info

Posted by on August 9, 2013 • Filed Under Programming, Tutorials

This code is very useful if you have a WordPress website with multiple authors. The code will display a section with your gravatar, name and a little bio (the one you fill out in your user profile). This way, when people read an article written by you, they can see your info.

If you want this to appear on posts, you can add this snippet to single.php:

Feel free to style the classes (author-box, author-pic, author-name and author-bio) as you see fit on your CSS. The ‘100’ you see on the get_avatar function is the width and height of the gravatar. If it’s 100, then it would be 100×100, you can change it to any number.

If you have any questions, please let me know!



6 Comments


  • avatar image

    Corinne

    Aug 10, 2013

    Reply

    Thank you! I am a complete novice when it comes to code-writing so I'll take all the help I can get. This will be really useful if I ever have guest posts.

    • avatar image

      Nicole

      Aug 11, 2013

      Reply

      You're welcome Corinne, I'm glad this tutorial was useful!

  • avatar image

    Rita

    Aug 10, 2013

    Reply

    Thanks! This is a very useful article, especially if you have a multi-author blog.

    • avatar image

      Nicole

      Aug 27, 2013

      Reply

      You're welcome Rita, glad you liked it!

  • avatar image

    Aida Ingram

    Aug 27, 2013

    Reply

    What does it look like, and what does it look like when it is done? and what part do you fill in? thank you for your help?

    • avatar image

      Nicole

      Aug 27, 2013

      Reply

      It depends on the styling you give it using CSS, but you should see the avatar to the left, then the name and the bio description the user filled out on their profile. You add the snippet wherever you want it to show up. I suggest you add it after the post body content but before the user comments. I will edit the tutorial as soon as possible and add a preview of how it looks. Have a great day Aida!

Post your comments