Dukeo » WordPress » Blog Top Contributors: How To Show Them Without Any Plugin

Blog Top Contributors: How To Show Them Without Any Plugin

Steven 4 responses WordPress

You may want to display a list of your blog’s top contributors to show how hard people are working on your blog. Once again, there are several plugin-based solutions to achieve that, but you may want to keep your blog clean. Then the following solution is made for you.

All you need to do is paste the following code where you want the list of top contributors to be displayed:

mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());
$sql = "SELECT
    . "FROM
    . "WHERE ".$table_prefix.posts.".".post_parent."=0
    . "Group by
    . "Order by count(*) DESC\n"
    . "Limit 0,10";
$result = mysql_query($sql) or die(mysql_error());
echo "\n";
echo "<ul>";
while($row = mysql_fetch_array($result))
    echo "<li><strong>";
    echo $row['user_login'];
    echo "</strong>&nbsp";
    echo "(";
    echo $row['count(*)'];
    echo ")</li>";
echo "</ul>";

This code will display a list of your top contributors as well as the number of contributions for each person.

If you enjoyed this article,
Get email updates

Join for Free »


  1. Cool way to reward guest posters or site authors and showcase their status as contributors.

    1. Absolutely!
      It’s back to the basics: if you want to receive, you have to learn to give.

  2. Peter

    please can you email me the plugins that can do this. i am not a code person and wants to use a plugin.i appreciate your anticipated assistance.great job you are doing here.

    1. The whole point of this post is to show how to do that WITHOUT plugin…