Skip to content

Instantly share code, notes, and snippets.

@davoraltman

davoraltman/functions.php

Last active Dec 9, 2019
Embed
What would you like to do?
Add author name, says:, and Gravatar image to the title of each post
<?php
add_filter('the_title', 'daki_title');
function daki_title($dakisha_title) {
$daki_author_ime = get_the_author_meta('display_name');
$daki_author_email = get_the_author_meta('user_email');
$daki_author_slika = get_avatar_url($daki_author_email);
$dakisha_title = '<img width="16px" height="16px" src="' . $daki_author_slika . '" />' . " " . $daki_author_ime . ' says: ' . $dakisha_title;
return $dakisha_title;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment