Skip to content

Instantly share code, notes, and snippets.

@JamesHusband
Created February 6, 2017 14:45
Show Gist options
  • Save JamesHusband/4a4733cc0eacb45ebbe759e56b8f71a3 to your computer and use it in GitHub Desktop.
Save JamesHusband/4a4733cc0eacb45ebbe759e56b8f71a3 to your computer and use it in GitHub Desktop.
function lsmwp_post_limter($ids, $in, $count) {
$i = rand(1,$count);
if ($i <= $in) {
return($ids);
}
}
$limit_posts_2_5 = array('28741', '29811');
$limit_posts_1_3 = array('111');
$excluded_posts = lsmwp_post_limter($limit_posts_2_5, 2, 5);
$? = lsmwp_post_limter($limit_posts_1_3, 1, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment