database query for random posts
-
I have a query that pulls random posts from my site
You can check out the site http://www.dccollector.com and scroll to the bottom to see random posts.
I would like, however to pull random posts from the 2nd page of the pagination.
Here is the current query to pull the random posts…
<?php $randompost = $wpdb->get_results(“SELECT ID FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_type = ‘post’ ORDER BY RAND() LIMIT 12”);
What do I need to add to pull just from page 2 of the pagination? Or what do I need to take away or rewrite?
Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘database query for random posts’ is closed to new replies.