Support » Fixing WordPress » [Plugin: User Photo] List Authors with Photos

  • I’d like to know how I can display the list of authors with photos, this code only displays name.
    php wp_list_authors(‘show_fullname=1&optioncount=1’); php

    Thanks for the great plugin and suggestions.

    Me…

Viewing 11 replies - 1 through 11 (of 11 total)
  • Me too. I’m also looking for the same info

    I’d like to know was well, but I’m not holding my breath for anyone to help around here.

    Take a look at the plugin code and examine the code inside the template tag functions. I got a list of authors, then as I looped through them I was able to display their thumbnails like so:

    echo userphoto__get_userphoto($author->ID, USERPHOTO_THUMBNAIL_SIZE, '', '', array(), '');

    If you wanted fullsize it would just be a matter of changing the code a little. Hope this helps someone.

    Blizzo – can you please provide the full code snippet for displaying a full list of User Photo Thumbnails alongside their User Name ?

    This is killing me (well, my lack of PHP knowledge is killing me!)

    It’s not possible to customize how WP lists all the authors. You can only customize individual bios in author.php

    What we need is template tag that just grabs author usernames, so that you can loop through each and spit out their name, url, bio, etc. wp_list_authors() lists links without much control.

    To do this, you have to read the database to get a list of usernames or IDs. But even if you can do that, I don’t think that the_author_url() and other tags will let you specify the author as you loop through.

    Any experts out there with advice on doing this without hacking into wp-includes/author-template.php???

    Any help would be greatly appreciated…

    Check this out 🙂

    http://www.helloelbow.com/the-crew/

    you should take a look at the readme file provided with the download of the cimy user field plugin.

    I just figured out a way to either display your author’s User Photo or avatar. I couldn’t add the code here so you can check out my solution at http://bavotasan.com/tutorials/how-to-display-an-author-list-with-avatars-in-wordpress/

    @ tinkerpriest
    thanks for sharing your code!
    i’m using it and it’s working with get_avatar($id); but when i insert userphoto($id); i only get a list of the users but no pics. user-photo is installed and working…
    do you have any idea what i can do to solve this?
    cheers!

    @ JakeThePeg

    The Crew page looks great. Exactly what I am looking for. Any possibility I could get the code you used, to do that?

    Thanks a bunch for your time, really appreciate it.

    Try this:

    <?php
    global $wpdb;
    $query = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename";
    $author_ids = $wpdb->get_results($query);
    foreach($author_ids as $author) :
    $curauth = get_userdata($author->ID);
    if($curauth->user_login !== 'admin') :
    $user_link = get_author_posts_url($curauth->ID);
    $avatar = 'default';
    ?>
    <div class="autor" title="<?php echo $curauth->display_name; ?>">
    <?php if(userphoto_exists($curauth)) userphoto_thumbnail($curauth); else echo get_avatar($curauth->ID, 40); ?>
    </div>
    <?php endif; ?>
    <?php endforeach; ?>

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: User Photo] List Authors with Photos’ is closed to new replies.