kk Star Ratings WordPress plugin customization

i needed a voting system for a client’s wordpress website so i installed this plugin: kk Star Ratings

the standard version is great but has very few options. the quickest way to achieve what the client wanted was to customize the plugin a little bit

show voting only for logged in users

i had to replace the voting box with a message inviting the user to login/signup

i edited the file /wp-content/plugins/kk-star-ratings/index.php

search for this line:

and replace it with:

of course you can include HTML code between ‘ ‘ to further edit the message: include a link to login page, change the appearance (float, background)

hide voting on some posts

with kk Star Ratings you can choose where you want the ratings to be placed (homepage, archives, posts, pages, categories) but you can’t hide it from some posts (custom posts in my case)

so i edited the file /wp-content/plugins/kk-star-ratings/index.php

search for this line:

and replace it with:

where 101,151,1001 from the array are the ID’s of the posts

4 thoughts on “kk Star Ratings WordPress plugin customization”

  1. Hi,

    I have several comparison tables on my site, used to compare products.
    I want to use the rating shortcode to allow users to submit votes on each product.

    The problem is that if you vote on one product, it applies the same vote to all other products.

    Is there a way to allow for multiple, unique votes on one singular page?

    e.g. https://inplayempire.com/best-uk-bookmakers/top-uk-betting-sites/

    Best
    Charlie
    @kamalkhan
    Owner
    kamalkhan commented on 16 Feb 2018

    By default, the star ratings is applied for the current post/page or custom post being viewed.

    In your case, you want to distinguish star ratings in the same post/page without sticking it to the current post id. To do that, you have to manually use the shortcode and set the id of the custom post.

    Example shortcode use case:

    Product Foo [kkstarratings id=”590″]
    Product Bar [kkstarratings id=”591″]
    Product Baz [kkstarratings id=”592″]

    If you use id’s where do you explain the id? In css?
    And how ?

  2. Hi thanks for your awesome post.
    i have a problem.
    when i install kk star ratings on my site i tested my site on google structured data testing tool and i find this errors.
    “Field ratingValue may not be empty”
    “One of ratingCount or reviewCount must be provided”
    please help me.
    how can i add one star to all wordpress posts for resolve this problem.

  3. Thank you for article .
    in need show just ” ratingValue ” in category post.
    please help me. Thanks .

Leave a Reply

Your email address will not be published. Required fields are marked *