public
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6
To call the function I do something like this:
 
$cat = '2,6,3,4,12,11,17,16,125,1,13,9,7,15,49,51';
$posts = get_popular_posts_array( array( 'range' => 'all', 'limit' => 24, 'cat' => $cat, 'pid' => '2694,2696,2699' ) );
 
And then I do a foreach using the $posts array. This way I can even use it twice or as many times as I want without repeating the query.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.