Exclude categories from Loop, queries, widgets, post navigation
Excluding categories with pre_get_posts() I found that excluding a category via pre_get_posts() and set_query_var() would work fine except for widgets. The Recent Post Widget would only exclude the category when using $query->set() instead. <?php /** * Does NOT apply to the Recent Posts widget. */ function glck1403271109_exclude_categories( $query ) { $excluded = array( ‘1’, ‘2’ … Read more