Created
May 8, 2012 16:03
-
-
Save codearachnid/2636709 to your computer and use it in GitHub Desktop.
Wordpress: get all posts (or limit) from/by custom post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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