Guest User

eg_get_all_ids_in_query

a guest
Nov 6th, 2013
187
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data