Alternative to using get_avatar function?
-
30-10-2019 - |
Question
I used a WP hack for displaying author's pics. For example, my single.php has an author slug which displays the author's pic.
I created a folder called authors in my theme/images folder. Based on the author's ID, I name the file 1.jpg, 2.jpg and so on.
So I call this image as
<img src="<?php bloginfo('template_directory') ?>/images/authors/<?php the_author_ID()?>.jpg" alt="<?php the_author(); ?>">
Now i'm modifying a plugin that displays the authors in the sidebar. However this plugin uses the get_avatar function, which is as follows:
/**
* If show avatar option is checked, add get_avatar function to cache.
*/
if($jmetc_options['show_avatar'] == 1) {
$jmevar['cache'] .= get_avatar($tc->comment_author_email, $jmetc_options['avatar_size']);
}
Can someone advise me on how to use/modify the get_avatar in order to use the default code that I use?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange