/ Published in: PHP

Add to functions.php. Replace IDs (64, 104 below) with categories you want to exclude.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function BI_exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '-64,-104' ); } } add_action( 'pre_get_posts', 'BI_exclude_category' );
Comments
