WordPress.org

Ready to get started?Download WordPress

Forums

get_avatar suggesstion: get_avatar_src() (1 post)

  1. alkafy
    Member
    Posted 4 years ago #

    I have a rare situation where the avatar must be in an element's background-image css property instead of in an img tag. As is, I strip the image src using regex.

    A "get_avatar_src" function, like wp_get_attachment_image_src, would be useful here.

    Example:
    <div style="background-image:url('<?php echo get_avatar_src($user_id,32); ?>');" class="avatar"></div>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags