jjgrainger / wp-custom-post-type-class

A PHP Class for creating Wordpress Custom Post Types easily
MIT License
416 stars 114 forks source link

Method for set the number of posts per page of a post_type #22

Closed mateusneves closed 9 years ago

mateusneves commented 10 years ago

I think it would be great to create a method to set the number of posts per page

jjgrainger commented 10 years ago

Thanks, I'll look into this :)

jjgrainger commented 9 years ago

Hey @mateusneves

Sorry its been so long, I've been considering creating a method for setting the number of posts per page for a while, however I think this won't be ideal.

The class has been built as a utility for making custom post types with a focus on creating a better admin interface, with no means of effecting the front end.

I would argue it would be simpler to modify the posts per page within templates using WP_Query() or get_posts(), or better still creating an action to modify pre_get_posts query. This way you will have more control on how and where the number of posts is being modified.

Thanks for your request :)

mateusneves commented 9 years ago

Hey @jjgrainger, im understand your explanation and i agree with that. Thaks for your answer.