Fix for avatars plugin docs

In the avatars pluging docs it says to add this to show the blog avatar:

<?php echo get_blog_avatar(1,'32','identicon'); ?>

That's probably not what you want because it will always show the avatar for blog 1. Here is what you probably want:

<?php echo get_blog_avatar($wpdb->blogid, '32', 'identicon'); ?>

    Jake
    • 3
    • #20,376

    Even though it's a few months old, this is exactly what I was looking for. Is the updated code pulling the blog avatar for the author of each post or the blog that owns the post?

    Andrew
    • Erstwhile founder
    • 7,430
    • #14

    Hi Guys,

    That bit of code is just an example, it's not meant to be used as is.

    Is the updated code pulling the blog avatar for the author of each post or the blog that owns the post?

    The code lucidology provided will display the blog avatar.

    Thanks,
    Andrew

    Jake
    • 3
    • #20,376

    Thanks Andrew. The code Lucidology provided actually works great in my case, except it's only pulling the avatar for Blog 1. (I'm using it in conjunction with the recent global posts widget)

    I'd like to have it pull the avatar for the blog that each post belongs to (even if it's the same author between blogs). Can you point me in the right direction?

    Andrew
    • Erstwhile founder
    • 7,430
    • #14

    Hiya,

    You'll need to replace $wpdb->blogid with a variable containing the blog id the post is published on.

    Hopefully that will help. Unfortunately we really can't provide custom coding assistance.

    Thanks,
    Andrew

Join 365945 happy members

Get access to our entire collection of epic plugins, astonishing themes & genius support

Become a member