Get post ids from WP_Query?

Is there a way I can retrieve an array of post ids queried from the following: $latest = new WP_Query( array ( ‘orderby’ => ‘rand’, ‘posts_per_page’ => 3 )); if ( $latest -> have_posts() ) : while ( $latest -> have_posts() ) : $latest -> the_post(); get_template_part( ‘templates/content’, ‘post’ ); endwhile; endif; wp_reset_postdata(); Follow Up: … Read more

posts_per_page no limit

I want to return ALL posts with query_posts. I tried setting posts_per_page to a really high number, but query_posts freaks out and doesn’t return any posts. What is the correct way to query posts without a limit? $args = array( ‘post_type’ => ‘post’, ‘cat’ => ‘22,47,67’, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1, … Read more