Support » Plugin: WP-PostRatings » Show number of points on author page?

  • andy999


    Is it possible to show how many points a user has on their author page?

    Lets say you have a multi user site and each member can make posts that are voted on with the up/down ratings, is it possible to calculate how many points the user has and show that on their author page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Lester Chan


    You can probably get all the post ID that the author has make and base on the post ids, get the post meta “ratings_score” and sum it all up.



    I found this little snippet kicking around but it doesn’t seem to output anything when I put it on the author page, what am I doing wrong?

    function ac_author_score() {
    	$userID = get_the_author_meta( 'ID' );
    	$query = array (
    		'author' => $userID,
    		'posts_per_page' => -1
    	$queryObject = new WP_Query($query);
    	while( $queryObject->have_posts() ) : $queryObject->the_post();
    	global $post;
    	$postID = $post->ID;
    	$score = $score + intval( get_post_meta( 'ratings_score', $postID, true ) );
    	if ( $score > 0 )
    		$score = '+' . $score;
    	return $score;
    Plugin Author Lester Chan


    Because the function is returning the $score instead of printing it out?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show number of points on author page?’ is closed to new replies.