Guest User

Untitled

a guest
Aug 12th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. function five_posts_on_category( $query ) {
  2. if ( $query->is_category() && $query->is_main_query() ) {
  3. $query->set( 'posts_per_page', 5 );
  4. }
  5. }
  6. add_action( 'pre_get_posts', 'five_posts_on_category' );
Advertisement
Add Comment
Please, Sign In to add comment