WordPress.org

Support

Support » How-To and Troubleshooting » How to show ratings only in selected author's post?

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

  • 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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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));
    }
    ?>

    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

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show ratings only in selected author's post?’ is closed to new replies.