ControlledChaos
5/7/2015 - 9:49 AM

Exclude Category from Home Page

Exclude Category from Home Page

<?php

  function ccd_exclude_categories( $query ) {
    if ( $query->is_home ) {
      $query->set( 'cat', '-1,-5,-10' );
    }
    return $query;
  }
  add_filter( 'pre_get_posts', 'ccd_exclude_categories' );

?>

Exclude Category from Home Page

WordPress Snippet