WordPress.org

Ready to get started?Download WordPress

Forums

WP Customer Reviews
Displaying Random Comments (3 posts)

  1. mikeweeks
    Member
    Posted 1 year ago #

    I wanted to display a random comment from the database. Really quite simple, just find date_time DESC in the main file and change for RAND()

    Mike

    http://wordpress.org/extend/plugins/wp-customer-reviews/

  2. essaysnark
    Member
    Posted 1 year ago #

    @mikeweeks I know your question is really old but we hacked a solution to this. In wp-customer-reviews.php, on line 420, replace part of the FROM line like so:

    ORDER BY date_time DESC $limit

    to

    ORDER BY RAND(UNIX_TIMESTAMP(NOW())) $limit

    There's backticks in the original bit around date_time. Ditch those, none needed in the replacement (keep the first part of the line with FROM obviously - I couldn't copy in the whole thing here due to the backticks).

  3. essaysnark
    Member
    Posted 1 year ago #

    Doh. Just realized that you were posting a SOLUTION not a question. Wish I'd found yours earlier!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic