Last active
December 9, 2019 23:47
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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