Support » Plugins and Hacks » Show random comment?

Show random comment?

  • I’ve looked everywhere but can’t find a simple solution.

    I want to show one random comment anywhere on my site. I’d also would like to show the comment author name and link to the post in which the comment resides.

    Post list manages to show the author and link, but not the comment itself. It’s also has to be in the dynamic sidebar.

    Some SQL requests could dig up the data I need, but all I find are the SQL request code, but not to initiate an SQL request using PHP.

    Any clues? Thank you in beforehand

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am also looking for a plugin which can handle this.

    I just want to display comments of a page randomly in anywhere in my page.

    in wp-includes.php around line 216 comment out the following
    $orderby = 'comment_date_gmt'; // Hard code for now

    IF your sql version allows for the RAND argument then itll work when you pass $orderby=rand in the get_comments function.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show random comment?’ is closed to new replies.
Skip to toolbar