srikat

Untitled

Jan 25th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. add_action( 'pre_get_posts', 'sk_change_testimonial_posts_per_page' );
  2. /**
  3. * Change Posts Per Page for Testimonial Archive
  4. *
  5. * @author Bill Erickson
  6. * @link http://www.billerickson.net/customize-the-wordpress-query/
  7. * @param object $query data
  8. *
  9. */
  10. function sk_change_testimonial_posts_per_page( $query ) {
  11.  
  12. if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'testimonial' ) ) {
  13. $query->set( 'posts_per_page', '6' );
  14. }
  15.  
  16. }
Add Comment
Please, Sign In to add comment