Advertisement
Guest User

eg_get_all_ids_in_query

a guest
Nov 6th, 2013
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. //get all id's ignoring global wp_query posts_per_page
  2.  
  3. function eg_get_all_ids_in_query() {
  4.     global $query_string;
  5.  
  6.     $query = query_posts( $query_string . '&posts_per_page=-1' );
  7.  
  8.     $temp = array();
  9.     while ( have_posts() ) : the_post();
  10.         $temp[] = get_the_ID() ;
  11.     endwhile;
  12.     return $temp;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement