{"id":3870,"date":"2014-06-02T18:41:01","date_gmt":"2014-06-02T18:41:01","guid":{"rendered":"http:\/\/www.dognmonkey.com\/techs\/?p=3870"},"modified":"2014-06-02T18:43:03","modified_gmt":"2014-06-02T18:43:03","slug":"author-avatar-picture-in-wordpress-3-9-x","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/techs\/author-avatar-picture-in-wordpress-3-9-x.html","title":{"rendered":"Author Avatar Picture In WordPress 3.9.X"},"content":{"rendered":"<p style=\"text-align: center;\"><em>My aunt asked me to show her picture on her WP blog for author instead of these self generated avatar. After searching on the internet, here is how I did it for her.<\/em><\/p>\n<p style=\"text-align: center;\"><em><a title=\"display author's picture\" href=\"https:\/\/core.trac.wordpress.org\/browser\/tags\/3.6.1\/wp-includes\/pluggable.php#L1588\" target=\"_blank\">The code needed in the functions.php of the theme<\/a>.<\/em><\/p>\n<p style=\"text-align: center;\"><em>The code needed in the loop (main) and loop-single (post).<\/em><\/p>\n<blockquote>\n<p style=\"text-align: center;\">&lt;?php echo get_avatar( get_the_author_email(), &#8217;60&#8217; ); ?&gt; 60 is the size of the image in pixels.<\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><em>loop<\/em><\/p>\n<blockquote>\n<p style=\"text-align: left;\">&lt;span class=&#8221;comments-link&#8221;&gt;&lt;?php comments_popup_link( __( &#8216;Leave a comment&#8217;, &#8216;twentyten&#8217; ), __( &#8216;1 Comment&#8217;, &#8216;twentyten&#8217; ), __( &#8216;% Comments&#8217;, &#8216;twentyten&#8217; ) ); ?&gt;&lt;\/span&gt;<br \/>\n&lt;?php edit_post_link( __( &#8216;Edit&#8217;, &#8216;twentyten&#8217; ), &#8216;&lt;span class=&#8221;meta-sep&#8221;&gt;|&lt;\/span&gt; &lt;span class=&#8221;edit-link&#8221;&gt;&#8217;, &#8216;&lt;\/span&gt;&#8217; ); ?&gt;<br \/>\n&lt;?php echo get_avatar( get_the_author_email(), &#8217;60&#8217; ); ?&gt;<\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop.jpg\" rel=\"lightbox[avatar]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3873\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop-300x216.jpg\" alt=\"loop avatar display\" width=\"300\" height=\"216\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop-300x216.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop.jpg 822w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>loop-single<\/em><\/p>\n<blockquote>\n<p style=\"text-align: left;\">&lt;div class=&#8221;entry-meta&#8221;&gt;<br \/>\n&lt;?php twentyten_posted_on(); ?&gt;&amp;nbsp;-&amp;nbsp;&lt;?php twentyten_posted_in(); ?&gt;&amp;nbsp;&lt;?php the_views(); ?&gt;&amp;nbsp;&lt;small&gt;&lt;span class=&#8221;st_sharethis_hcount&#8221;&gt;&lt;\/span&gt;&lt;\/small&gt;&lt;div class=&#8221;fb-like&#8221; data-href=&#8221;\/\/www.tambl.net&#8221; data-send=&#8221;false&#8221; data-layout=&#8221;button_count&#8221; data-width=&#8221;450&#8243; data-show-faces=&#8221;true&#8221; data-font=&#8221;lucida grande&#8221; data-colorscheme=&#8221;dark&#8221;&gt;&lt;\/div&gt;<br \/>\n&lt;?php echo get_avatar( get_the_author_email(), &#8217;60&#8217; ); ?&gt;<\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop_single.jpg\" rel=\"lightbox[avatar]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3872\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop_single-300x150.jpg\" alt=\"loop_single avatar display\" width=\"300\" height=\"150\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop_single-300x150.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop_single-1024x512.jpg 1024w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/loop_single.jpg 1061w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>We do need avatar picture loaded, I use<a title=\"author image plugin\" href=\"https:\/\/wordpress.org\/plugins\/sem-author-image\/\" target=\"_blank\"> Author Image plug-in<\/a>, it&#8217;s easy to use.<\/em><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/author_image.jpg\" rel=\"lightbox[avatar]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3874\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/author_image-300x252.jpg\" alt=\"author_image plugin\" width=\"300\" height=\"252\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/author_image-300x252.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/06\/author_image.jpg 928w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul><\/p>\n","protected":false},"excerpt":{"rendered":"<p>My aunt asked me to show her picture on her WP blog for author instead of these self generated avatar. After searching on the internet, here is how I did it for her. The code needed in the functions.php of the theme. The code needed in the loop (main) and loop-single (post). &lt;?php echo get_avatar( <a href=\"https:\/\/www.dognmonkey.com\/techs\/author-avatar-picture-in-wordpress-3-9-x.html\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,16,20],"tags":[476,474,477,478,475],"class_list":["post-3870","post","type-post","status-publish","format-standard","hentry","category-themes","category-tips-and-tricks","category-wordpress","tag-author-picture","tag-avatar-picture","tag-loop","tag-loop-single","tag-wp-3-9-x"],"views":211,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/3870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/comments?post=3870"}],"version-history":[{"count":4,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/3870\/revisions"}],"predecessor-version":[{"id":3877,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/3870\/revisions\/3877"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media?parent=3870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/categories?post=3870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/tags?post=3870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}