Advertisement
Guest User

Untitled

a guest
Feb 17th, 2022
66
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function r12t_exclude_category($query) {
  2. if ( ! is_admin() && $query->is_main_query() ) {
  3. if ( is_front_page() ) {
  4. $query->set( 'cat', '-1' );
  5. }
  6. }
  7. return $query;
  8. }
  9. add_filter( 'pre_get_posts', 'r12t_exclude_category' );
Advertisement
RAW Paste Data Copied
Advertisement