WordPress.org

Support

Support » How-To and Troubleshooting » how to get author url

how to get author url

  • <?php
    function topauthors() {

    $uc=array();

    $blogusers = get_users_of_blog();

    if ($blogusers) {

    foreach ($blogusers as $bloguser) {

    $post_count = get_usernumposts($bloguser->user_id);

    $uc[$bloguser->user_id]=$post_count;

    }

    arsort($uc); //use asort($uc) if ascending by post count is desired

    $maxauthor=10;

    $count=0;

    foreach ($uc as $key => $value) {

    $count++;

    if ($count <= $maxauthor) {

    $user = get_userdata($key);

    $author_posts_url = get_author_posts_url($key);

    $post_count = $value;

    echo ‘ ‘ . $user->user_firstname . ‘ ‘ . $user->user_lastname .'(RSS) (‘. $post_count. ‘)’;

    }

    }

    }

    }

    ?>

    i am using this code for top 10 authors it is working but i didnt get authors url. and i dont wana use plugin so any one kindly help me regarding this.

    my website is http://www.chowrangi.com

    i need top 10 authors by post and there url.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to get author url’ is closed to new replies.
Skip to toolbar