Skip to content

Instantly share code, notes, and snippets.

@Roberto-Sudo
Created October 8, 2013 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Roberto-Sudo/6893243 to your computer and use it in GitHub Desktop.
Save Roberto-Sudo/6893243 to your computer and use it in GitHub Desktop.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment