I'm developing a "related posts" kind of plugin and want to show random related posts in specific category. That's the easy part and I'm doing it like this:
$args=array(
'category__in' => $categories,
'showposts' => $post_count,
'orderby' => 'rand',
);
$related_query = new WP_Query($args);
Now my problem is that the post count is not always met and I want the query to always return the number of posts specified.
For example, my $post_count is 4 but the category we're querying only returns 2 posts. I want the rest to fill in with random posts.