Adding avatar to a block..

Posted in: Newspaper
Post count: 5

I have added an author avatar to posts using
<?php echo get_avatar( get_the_author_meta('ID'), 60); ?>

Does anyone know how I can call the user avatar to display on a block? The code above does not work, it pulls in the same avatar for every post.

Post count: 23312

Hello websitehelper,

If you want the code to get dynamically your authors you should add the following code to your modules template. Below, I gave you an example for td_module_2.php like this -> https://www.screencast.com/t/jvaI8mGnHfwc and the code should have to be added should look like this ->
<?php echo get_avatar( get_the_author_meta('ID',$this->post->post_author), 30); ?>

Hope this helps!

Thanks for the message!

Post count: 5

Excellent. Thank you very much.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.