Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Well, what about other badges they’ve earned? I’m sure there are ways to do it via filters, the question is specifics for what you want and how to get to that point.

    Thread Starter trainercom

    (@trainercom)

    Right now I’m only going to use one badge to show expert status. I want that to show next to their username or as part of their avatar so everyone can see it each time they use the site.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Are you familiar with WP filter hooks at all? Also how big are the avatars that you’re showing? Curious because you’d need tiny badge images if you were to overlay them. However, if they just need to be next to each other, that’s a bit easier.

    I was thinking you could easily add a filter to get_avatar, which will return something close to the following:

    <img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />;

    The parts inside the {} would be actually rendered out at the end of the parsing. What you could do in this case is add a filter to this, and then query for your “Expert status” badge image, and append to the output. Then you’d just return both the original + your new img tag.

    Let me know if you want some more help with this part, or need an example filter. Otherwise I’ll let you run wild with it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Badge on Avatar or Next o Username’ is closed to new replies.