Viewing 1 replies (of 1 total)
  • Thread Starter TuneInTokyo

    (@tuneintokyo)

    I have found a workaround by directly querying the database, but i would prefer not to have to do this.

    My solution:

    $offset = $wpdb->get_var("SELECT FLOOR(RAND() * COUNT(*)) FROM wp_quotescollection");
    $random_quote = $wpdb->get_row("SELECT * FROM wp_quotescollection LIMIT $offset, 1");

    Then i can echo $random_quote->quote_id etc.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Quotes Collection] Get id of displayed quote’ is closed to new replies.