• Trying to create a nicer Author list for compliance with Google news requirements.

    The standard wp_list_authors is okay for sidebras but way to basic for page display.

    Have created this which is half working but cannot include descriptions etc.

    Would anyone care to take a look at the code annd help?

    Problems seem to be revolving around use of get_the_author_meta as this does display but only the list of authors and avatars, not the description

    <?php
    $authors = wp_list_authors('optioncount=1&exclude_admin=0&echo=0');
    $authors = explode('<li>', $authors);
    foreach ($authors as $names) {
    $names = str_replace('</li>',"",$names);
    $idBeg = strpos($names,'author=');
    $post = substr($names, $idBeg);
    $idEnd = strpos($post, '"');
    $id = substr($post, 0, $idEnd);
    $id = str_replace('author=',"",$id);
    if($id) {
    echo '<li>';
    echo '<div class="avaright">';
    echo get_avatar($id);
    echo '</div>';
    echo get_the_author_meta('description',$id);
    echo '<div class="authname">';
    echo $names;
    echo '</div>';
    echo '</li>';
    }
    }
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ozpoker

    (@ozpoker)

    Anyone?

    Thread Starter ozpoker

    (@ozpoker)

    Really? No one knows how to fix this?

    hope not out of date, but found and offer you other solution ->

    $blogusers = get_users_of_blog();
    if ($blogusers) {
       foreach ($blogusers as $bloguser) {
           $user = get_userdata($bloguser->user_id);
           echo "<pre>";
           print_r($user);  // show all user information you can use
           echo "</pre>";
    
           // sample of use
           echo $user->ID;
           echo $user->display_name;
       }
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trying to create an attractive Author list’ is closed to new replies.