WordPress : Issue with wp_query and gd star rating plugin

I have used GD Star Rating plugin with my WordPress installation, for creating 2 different sets of Ratings (Posts and Videos). (I was not able to find any other plugin that supports this feature).

I have used following arguments in one wp_query to display a list of top rated videos, and it’s working fine.

$args=array(
    'post_type' => 'youtube_videos',
    'post_status' => 'publish',
    'posts_per_page' => 10,
    'gdsr_sort' => 'rating',
    'gdsr_multi' => 3
);

On the same page, i am trying to show a list of top rated posts, with following arguments in wp_query, but it’s not working.

$args=array(
    'posts_per_page' => 4,
    'post_type' => 'post',
    'gdsr_sort' => 'rating',
    'gdsr_multi' => 0
);

I found that issue is with value passes in ‘gdsr_multi’ varibale, if i remove this variable from the top rated videos 2nd part of code works fine.

I am not being able to run both together, any suggestions please?


For gdsr_multi variable documentation of GD Star rating plugin says:

  • For standard rating data, don’t use this variable, or set it to zero.
  • To get multi ratings data this variable must be set to multi set id to use.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)