Hello, friends! In this post, I would like to explain how to write PHP code in an author widget on my WordPress blog. Previously, we learned about how to create WordPress widgets and executing PHP code in a WordPress widget. This post extends the previous ones.

WordPress is a versatile platform that allows you to customize your website in countless ways. One essential element for many websites is the Author Widget, which displays information about the content’s creator. In this article, we’ll walk you through the process of creating a custom PHP Author Widget for WordPress. Whether you want to showcase the author’s name, bio, social links, or more, this tutorial will help you achieve a personalized and engaging author widget for your WordPress site.

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.

1
<?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

In conclusion, a custom PHP Author Widget for WordPress can enhance the user experience by providing valuable insights into the creators behind your content. With the step-by-step guide we’ve provided, you can easily create a unique author widget that suits your website’s needs and style. This small but impactful addition can make a big difference in connecting with your audience and building a sense of trust and credibility on your WordPress site. So, go ahead, implement this feature, and enjoy the benefits of a personalized author widget on your website.

Categories: CMSWordpress

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *