pusatdata

WP-Trik: Cara Menyembunyikan Kategori di HOME

Oct 14th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. function exclude_category_home( $query ) {
  2. if ( $query->is_home ) {
  3. $query->set( 'cat', '-5, -34' );
  4. }
  5. return $query;
  6. }
  7.  
  8. add_filter( 'pre_get_posts', 'exclude_category_home' );
Add Comment
Please, Sign In to add comment