WordPress.org

Ready to get started?Download WordPress

Forums

Rate
the_rating() seems not to be clickable (6 posts)

  1. jonandrewgreig
    Member
    Posted 2 years ago #

    Hi there,

    I know it's been a while since the plugin was released, so I know there might be a chance it could be a version indiscrepancy, but is one supposed to rate a post or page with "the_rating()" or "the_comment_rating()"? I'm wondering because it seems like one should be able to rate the post/plugin in general, but I can't click the stars or make a rating that way. Any ideas on why this might be the case? Thanks!

    Jon

    http://wordpress.org/extend/plugins/rate/

  2. yashodhan
    Member
    Posted 2 years ago #

    Having the same problem here. Latest version of WP.

    The comment rating stars are greyed out and unclickable.

  3. wintermute77
    Member
    Posted 2 years ago #

    I haven't gone through the plugin in detail so this is posted as a hacky fix to get stuff working rather than an actual solution, but:

    The problem appears to be that the javascript is looking for elements with a class of "needs-rating" or "form-rating", but the stars are output inside a list with a class of just "rating".

    Add the "rating" class to the list of elements that the JS attaches to, and the stars start working again.

    In detail:
    /plugins/rate/js/rate.js

    Line 6:
    Change
    var nratings, fratings;
    to
    var nratings, fratings, sratings;

    Line 72:
    Immediately below:
    fratings = $('.form-rating li');
    add the line:
    sratings = $('.rating li');

    Line 76:
    Immediately below:
    nratings.bind('mouseenter mouseleave', doHover).click(doRating);
    add the line:
    sratings.bind('mouseenter mouseleave', doHover).click(doRating);

  4. barbaralyschenko
    Member
    Posted 2 years ago #

    Yes! this plugin works with this solution. thanks #wintermute77 .

  5. timbunch
    Member
    Posted 2 years ago #

    That does appear to fix the issue for me too. I noticed it primarily in Chrome.

  6. timbunch
    Member
    Posted 2 years ago #

    Now if only it would actually save the rating in the comment_karma field...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags