Skip to content

Instantly share code, notes, and snippets.

@davoraltman
Last active December 9, 2019 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davoraltman/f682c24be33fa5e71d6ec452838ea2b0 to your computer and use it in GitHub Desktop.
Save davoraltman/f682c24be33fa5e71d6ec452838ea2b0 to your computer and use it in GitHub Desktop.
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