WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: User Photo] List Authors with Photos (12 posts)

  1. issy-m
    Member
    Posted 6 years ago #

    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...

  2. juliochacon23
    Member
    Posted 6 years ago #

    Me too. I'm also looking for the same info

  3. picard102
    Member
    Posted 6 years ago #

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

  4. blizzo
    Member
    Posted 5 years ago #

    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.

  5. JakeThePeg
    Member
    Posted 5 years ago #

    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!)

  6. thecoup
    Member
    Posted 5 years ago #

    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...

  7. JakeThePeg
    Member
    Posted 5 years ago #

  8. Franz Josef Kaiser
    Member
    Posted 5 years ago #

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

  9. c.bavota
    Member
    Posted 5 years ago #

    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/

  10. clyk
    Member
    Posted 5 years ago #

    @ 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!

  11. joemendonca
    Member
    Posted 5 years ago #

    @ 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.

  12. maloca66
    Member
    Posted 5 years ago #

    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; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags