Skip to content

Instantly share code, notes, and snippets.

@codearachnid
Created May 8, 2012 16:03
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 codearachnid/2636709 to your computer and use it in GitHub Desktop.
Save codearachnid/2636709 to your computer and use it in GitHub Desktop.
Wordpress: get all posts (or limit) from/by custom post type
function get_all_posts_cpt( $request ) {
if( $request['post_type'] == 'distribution')
$request['posts_per_page'] = -1;
return $request;
}
add_filter( 'request', 'get_all_posts_cpt' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment