excluding epicenter categories from the recent posts in the sidebar
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 16 Apr 2019 17:50:02 +0000 (13:50 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 16 Apr 2019 17:50:02 +0000 (13:50 -0400)
functions.php

index 1496f11..322a0a2 100644 (file)
@@ -743,3 +743,14 @@ function fusion_doing_ajax() {
 }
 
 /* Omit closing PHP tag to avoid "Headers already sent" issues. */
+add_action('wp', 'check_home');
+function check_home() {
+    if(is_home() || is_category()) {
+        function modify_widget() {
+            $r = array( 'cat' => '-70');
+            return $r;
+            }
+    
+        add_filter('widget_posts_args','modify_widget');
+    } 
+}
\ No newline at end of file