Advertisement
srikat

Untitled

Jan 22nd, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. add_action( 'pre_get_posts', 'sk_change_office_status_posts_per_page' );
  2. /**
  3.  * Change Posts Per Page for office-status taxonomy archives
  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_office_status_posts_per_page( $query ) {
  11.    
  12.     if( $query->is_main_query() && !is_admin() && is_tax( 'office-status' ) ) {
  13.         $query->set( 'posts_per_page', '5' );
  14.     }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement