PHP code for Author Widget in WordPress

in CMS, Wordpress / No Comments

Hi friends, in this post I would like like explain how to write php code in author widget in wordpress blog. In earlier we learned about how to create WordPress widgets and execute PHP Code in WordPress Widget, this post is extended to earlier posts.

PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

In this post I will explain with what I have implemented in my blog about author widget.

Step 1:

Open website https://en.gravatar.com/

Gravatar website for PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

Gravatar website for PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

Step 2:

Login to website and manage profile images

Gravatar manage for PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

Gravatar manage for PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

Step 3:

If you want to insert new image then go to https://en.gravatar.com/gravatars/new

Gravatar new image for PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

Gravatar new image for PHP code for Author Widget in WordPress by Anil Kumar Panigrahi

Now you will successfully created image for your account. In the earlier post I have explained about execute php code in wordpress widget. So now in your wordpress widget write the below code to get the image for author.

<?php echo get_avatar( '[email protected]', '80' ); ?>

Here get_avatar is function in wordpress, no need of re-written.
’80′ size of author image.
We can write our HTML or PHP code extra in that widget, then final outout will be

PHP code for Author Widget in WordPress by Anil Kumar Panigrahi - Author Widget

PHP code for Author Widget in WordPress by Anil Kumar Panigrahi – Author Widget

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>