WordPress.org

Ready to get started?Download WordPress

Forums

Author Avatars List
Show Only Avatars with Images? (10 posts)

  1. AllenPayne
    Member
    Posted 1 year ago #

    Hi,

    How can i show those users that have uploaded avatars? It currently shows all of them, including the ones that have the default avatar (which means they haven't uploaded one yet).

    Thanks.

    http://wordpress.org/extend/plugins/author-avatars/

  2. Paul Bearne
    Member
    Plugin Author

    Posted 1 year ago #

    I have no way to know if there is an avatar as I just call the wordpress function.

    The best I can suggest is for you write a jquery that looks for the URL of your default Image and removes the parent div with the class of user.

    Paul

  3. AllenPayne
    Member
    Posted 1 year ago #

    Thanks for getting back to me, Paul.

    The problem is, i have not idea how to do that. Can you or anyone else help or at least point me in the right direction?

    Thanks in advance.

  4. AllenPayne
    Member
    Posted 1 year ago #

    Can anyone help?

  5. Paul Bearne
    Member
    Plugin Author

    Posted 1 year ago #

    OK

    the trick id workout how to spot the default image

    What are you using to upload the avatar and setting the default

    THis example will work with WP USER AVATAR plug-in

    jQuery(".wp-user-avatar").parents("div.user").remove();

    pass be an URL and the plug-in you are using and I will look

  6. AllenPayne
    Member
    Posted 1 year ago #

    Well, I use buddypress and my members can upload an avatar (or use gravatar) on the profile page.

    The default avatar is currently displayed to all users who haven't uploaded an avatar yet (or don't have gravatar).

    The default avatar (mystery-man.jpg) is located at:

    wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg

  7. Paul Bearne
    Member
    Plugin Author

    Posted 1 year ago #

    try this (not tested)

    jQuery('div.user a[href$*="mystery-man.jpg"]').parents("div.user").remove();

  8. AllenPayne
    Member
    Posted 1 year ago #

    Okay, but where do i put this code? I use shortcode to display the avatar list on my site.

  9. AllenPayne
    Member
    Posted 1 year ago #

    I still can't figure out where to place your code. I would really appreciate some help. Thanks.

  10. Paul Bearne
    Member
    Plugin Author

    Posted 1 year ago #

    I need an URL or theme details

    But it goes into a JS file

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.