From 9d61ebc7819454c12060c4afe4b35e32589e8a61 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 2 Feb 2018 11:34:17 -0500 Subject: [PATCH] Only show 'popular tags' sidebar section on blog pages --- functions.php | 9 ++++++- sidebar.php | 69 ++++++++++++++++++++++++++------------------------- 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/functions.php b/functions.php index fa6ede3..a82d0f2 100644 --- a/functions.php +++ b/functions.php @@ -335,4 +335,11 @@ function restore_slider_behavior( $settings ) { $settings['infinite'] = 'true'; return $settings; } -add_filter( 'advanced-ads-slider-settings', 'restore_slider_behavior' ); \ No newline at end of file +add_filter( 'advanced-ads-slider-settings', 'restore_slider_behavior' ); + +// More concise way to check for blog-related pages +function is_blog () { + global $post; + $posttype = get_post_type($post ); + return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; + } \ No newline at end of file diff --git a/sidebar.php b/sidebar.php index 5c4c214..8b3566b 100644 --- a/sidebar.php +++ b/sidebar.php @@ -48,41 +48,42 @@ if ( ! is_active_sidebar( 'sidebar-1' ) ) { + + + -- 2.17.1