WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
How to show ratings only in selected author's post? (4 posts)

  1. asilonline
    Member
    Posted 1 year ago #

    How to show ratings only in selected author's post?

    The following code incorrectly,

    <?php wp_gdsr_render_rating_results(array('template_id' => 47, 'rows' => 10, 'select' => 'post', 'user_id' => 1, 'trends_rating' => 'img', 'trends_rating_set' => 'famfamfam', 'trends_voting' => 'img', 'trends_voting_set' => 'famfamfam', 'min_votes' => 1, 'min_count' => 1, 'excerpt_words' => 20)); ?>

    Please help me.

    http://wordpress.org/extend/plugins/gd-star-rating/

  2. alieneila
    Member
    Posted 1 year ago #

    You're wanting to show ratings only on a certain authors post, or only display a certain author's rating of a post? What you're doing above will display only author 1 (admin usually)'s rating of that post. If you want to display the rating only on a post authored by a certain person... try...

    <?php
    if ($post->post_author == 1) {
    wp_gdsr_render_rating_results(array('template_id' => 47, 'rows' => 10, 'select' => 'post', 'user_id' => 1, 'trends_rating' => 'img', 'trends_rating_set' => 'famfamfam', 'trends_voting' => 'img', 'trends_voting_set' => 'famfamfam', 'min_votes' => 1, 'min_count' => 1, 'excerpt_words' => 20));
    }
    ?>
  3. asilonline
    Member
    Posted 1 year ago #

    for example, I want to make a list of the author's most rating posts.

    for example, the following code shows the list of posts with the most rating category

    <?php wp_gdsr_render_rating_results(array('template_id' => 46, 'rows' => 10, 'select' => 'post', 'category' => get_query_var('cat'), 'trends_rating' => 'img', 'trends_rating_set' => 'famfamfam', 'trends_voting' => 'img', 'trends_voting_set' => 'famfamfam', 'min_votes' => 1, 'min_count' => 1, 'excerpt_words' => 20)); ?>

    I do not know good english, sorry

  4. alieneila
    Member
    Posted 1 year ago #

    To my knowledge, there isn't a built in function for GDSR to display the last x amount of posts rated for a certain author, it would require a custom function. Here is a site with a list and explanation of all of GDSR's built in functions...

    http://michaelaustinproductions.com/wp-content/plugins/gd-star-rating/info/functions.html

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic