Hello, welcome to therichpost.com. In this post, I will tell you, How to get Get author avatar for particular user inside the loop? Like I always say WordPress is the best cms.
Today In this post, we will get author avatar image in wordpress post loop and there are various methods and here are the working codes:
For comments: <?php echo get_avatar( $comment, 32 ); ?> For a post's author, in The Loop: <?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?> For a random email address: <?php echo get_avatar( 'email@example.com', 32 ); ?> For a specific user id: <?php $user_id = 2; echo get_avatar( $user_id, 32 ); ?>
There are so many tricks in wordpress and i will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com
You Might Also Like
Hello to all, welcome to therichpost.com. In this post, I will tell you, Wordpress trick to check term id has...