By default the WordPress get_posts function will return 5 posts, this code snippet allows you to retrieve all posts according to the other parameters passed in.
In the snippet below we'll get all posts by passing in a '-1' value for the 'posts_per_page' parameter:
$args( 'post_status' => 'publish', 'posts_per_page' => -1); $posts = get_posts( $args );
Simple as that.
Note, this will return everything so if you're using a custom post type that's going to run into the thousands this isn't likely to be the most efficient way to retrieve data.