Tangler Discussion Forums

Discuss

Topics

Click a Topicto start discussing

    sgd

    Hi Dan,

    On my new WPRS site, some of my users will comment on comments. When they do this, they don't add an addtional rating, so their comments show with zeroes across the board. I realize that all-zero ratings don't affect the overall score for that post (which is very good:) ), but I'd rather not show the ratings at all if the score for that comment is ZERO.

    Can you show a code example that would only display the ratings table/list if the score is non-zero?

    Thanks!

    2009-04-30 13:33:13.0

    Oh, a quick add-on: I'd also like to completely filter out zero-score reviews (i.e. not display that listing at all) from the "Recent Reviews" sidebar widget as well.

    2009-04-30 13:39:28.0

    For the comments template:

    <?php
    $ratings = get_comment_ratings();
    $show = false;
    foreach ($ratings as $rating)
       if ($rating > 0) $show = true;
    if ($show)
       comment_ratings_table();
    ?>

    Unfortunately the widget is not set up in a way to allow that.

    2009-04-30 14:23:25.0
    sgd

    That worked just fine, Dan, thanks! Too bad about the widget.

    2009-05-01 08:57:56.0

    Ok now where do you paste this code??? LOL

    2009-06-24 17:24:02.0
To send a message, Join Now (it's quick and free) or Sign In
Edit Topic
Delete Topic
Are you sure you want to delete the topic