From: Laury GvR Date: Tue, 16 Apr 2019 18:20:00 +0000 (-0400) Subject: Take epicenter blog widget reference from functions and add to sidebar X-Git-Tag: v1.0.0^2~21 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e8cfe165e0c9a4949f9b02c5d5918d63c0b1a174;p=WP-Themes%2Fmeetmtp.git Take epicenter blog widget reference from functions and add to sidebar --- 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()";