get authors
-
This hack shows the authors of your weblog
function get_authors($postCount = true, $excludeAdmin = true) {
global $tableusers, $tableposts, $wpdb, $author;
echo "<div id='authors'>";
echo "- ";
- " . (@($data->ID == $author) ? $data->user_nickname : "ID\">$data->user_nickname".($posts ? " ($posts)" : '')."") . '
$query = "SELECT ID, user_nickname from $tableusers " . ($excludeAdmin ? "WHERE user_nickname <> 'admin' " : '') . "ORDER BY user_nickname";
$res = $wpdb->get_results($query);
foreach($res as $data) {
$posts = ($postCount ? $wpdb->get_var("SELECT count(*) FROM $tableposts WHERE post_author=$data->ID") : 0);
echo "' ;
}
echo "";
echo "</div>";
}The function call could look like this: <?php get_authors(false, true); ?>
It works with Soarian 1.0.1
For a demo take a look at blog.lennartgroetzbach.de
- The topic ‘get authors’ is closed to new replies.