• Resolved klaxxe

    (@klaxxe)


    How can I enable avatars for authors, mods, and admins only. I want gravatar avatars to be enabled for authors+ and everyone else to be left blank, is this possible? Or no.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Please provide the code from your theme’s template file that deals with displaying gravatars/avatars (likely single.php), just the area relating to the avatar (3-4 lines above, down to 3-4 lines below).

    Also please use a pastebin, or alternatively just ensure code is posted inside backticks as shown in the reply box.
    http://wordpress.pastebin.ca/

    Possible yes, but far easier if i can see the code you have presently..

    Thread Starter klaxxe

    (@klaxxe)

    Sorry. Can anyone help me now?
    http://wordpress.pastebin.ca/1682741

    I do apologise, it should actually be comments.php or functions.php depending on whether you use a custom callback (function) for comments..

    Thread Starter klaxxe

    (@klaxxe)

    Im really not good at this stuff so ill give you both.

    comments.php here

    functions.php here

    Figured it would be a custom callback, it was in the functions file.

    Backup first, then replace your functions.php code with the following.
    http://wordpress.pastebin.ca/1683260

    Feel free to examine, i’ve only made changes to the comments callback function “art_comment”..

    NOTE: Make sure to copy the code from the secondary section that doesn’t include the line numbers (further down the page).

    Also when you do, update this area..

    $allowed_avatar = array(
    		'administrator' ,
    		'editor' ,
    		'author' ,
    		'contributor' ,
    		'subscriber'
    	);

    Remove the roles that are NOT allowed avatars. Make sure the last item does not have a comma following (as seen currently with subscriber)..

    For example if you wanted avatars for admin, editor and author only, it would look like so..

    $allowed_avatar = array(
    		'administrator' ,
    		'editor' ,
    		'author'
    	);

    Code was tested under PHP 5, MySQL 4 and using WP 2.8.6.

    Hope that helps.. 😉

    Thread Starter klaxxe

    (@klaxxe)

    i love you man. i really do.

    Glad i could help.. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Avatars for authors only’ is closed to new replies.