Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'pre_get_posts', 'sk_change_testimonial_posts_per_page' );
- /**
- * Change Posts Per Page for Testimonial Archive
- *
- * @author Bill Erickson
- * @link http://www.billerickson.net/customize-the-wordpress-query/
- * @param object $query data
- *
- */
- function sk_change_testimonial_posts_per_page( $query ) {
- if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'testimonial' ) ) {
- $query->set( 'posts_per_page', '6' );
- }
- }
Add Comment
Please, Sign In to add comment