Right now my site shows 3 random posts at the end of my single page articles. Here is the code I use and it works (with comments):
<?php $rand_posts = get_posts('numberposts=3&orderby=rand&post_type=any&cat=-15'); /* Alternative Expression: (include all post types, exclude catefory 'site' in the following code we define the post types explicitly instead of 'any'") $args = array( 'orderby' => 'rand', 'posts_per_page' => 3, 'category' => -1, 'post_type' => array( 'post', 'page', 'oldp' ) ); $rand_posts = get_posts( $args ); */ foreach( $rand_posts as $post ) : ?>
I would like the random posts to be my best posts, that is to be from a pool of posts I will choose or somehow identify. How can this be done.
I also have a code for random quotes that is quite simple and I wonder if I could use something as simple as that to specify the random posts pool:
$quotes = array( 'Quote1', 'Quote2', 'Quote3', ); return $quotes[rand(0, count($quotes)-1)];