Gravatar
Gravatar Image
If a member has registered their email with a Gravatar, you can display that image within your frontend code using the helpers from the Klub plugin.
<?php
$user = kirby()->user();
$gravatarUrl = $user->gravatar();
if ($gravatarUrl) { ?>
<img src="<?= $gravatarUrl ?>" alt="<?= $user->name() ?>">
<?php } else { ?>
<span><?= $user->initials() ?></span>
<?php } ?>
The URL to the image is cached for 60 minutes to avoid slowing down your frontend.