Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 特定のカテゴリの除外
- function exclude_category( $query ) {
- if ( $query->is_home() && $query->is_main_query() ) {
- $query->set( 'cat', '-8,-9' );//マイナスをつけてカテゴリIDを除外する
- }
- }
- add_action( 'pre_get_posts', 'exclude_category' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement