From e8cfe165e0c9a4949f9b02c5d5918d63c0b1a174 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 16 Apr 2019 14:20:00 -0400 Subject: [PATCH] Take epicenter blog widget reference from functions and add to sidebar --- functions.php | 20 ++++++++++---------- templates/sidebar-1.php | 9 ++++++++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/functions.php b/functions.php index 322a0a2..db02a50 100644 --- a/functions.php +++ b/functions.php @@ -743,14 +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_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 +// add_filter('widget_posts_args','modify_widget'); +// } +// } \ No newline at end of file diff --git a/templates/sidebar-1.php b/templates/sidebar-1.php index fed14a6..478b6aa 100644 --- a/templates/sidebar-1.php +++ b/templates/sidebar-1.php @@ -26,8 +26,15 @@ if (in_category(70)) { } } if (is_home()) { - echo "Do stuff when is_home()"; + echo "In cat 70 but also in home.."; + } +} else if (is_page(12465)) { + echo "Now we're on page 12465, Epicenter news"; + function modify_widget() { + $r = array( 'cat' => '-70'); + return $r; } + add_filter('widget_posts_args','modify_widget'); } else { if (is_home()) { echo "Do stuff when is_home()"; -- 2.17.1