Advertisement
Guest User

Untitled

a guest
Jan 9th, 2013
75
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', 'be_exclude_category_from_blog' );
  2. /**
  3.  * Exclude Category from Blog
  4.  *
  5.  * @author Bill Erickson
  6.  * @link http://www.billerickson.net/customize-the-wordpress-query/
  7.  * @param object $query data
  8.  *
  9.  */
  10. function be_exclude_category_from_blog( $query ) {
  11.    
  12.     if( $query->is_main_query() && $query->is_home() ) {
  13.         $query->set(  'cat', '-2258, -2806, -2695, -2654, -2767'  );
  14.             $query->set( 'posts_per_page', '53' );
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement