Adding a gravatar hovercard on WordPress
To add a gravatar hovercard using email, follow the steps below:- Log in to your WordPress site with an administrator account.
-
On the Dashboard in the left sidebar, click Appearance, and then click Theme Editor:
-
On the Theme Editor, select the Theme you want to edit from the dropdown:
-
The files for this selected theme is listed on the right column under Theme Files. Click on the file named “functions.php”:
- Insert the following code to the end of functions.php file. The function below is a modified version of the wpbeginner_display_avatar function. The function below creates a shortcode. The shortcode can be used with an email to display the gravatar of the user according to the email address:
- To display the gravatar on the page or post use the following shortcode: