$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
</section>
<?php dynamic_sidebar( 'sidebar-1' ); ?>
+ <?php if ( is_blog() ) { ?>
+ <section class="widget sidebar">
+ <!-- Only show for blog-related pages -->
+ <h2 class="widget-title">Popular Tags</h2>
+
+ <div class="widget-container popular-tags">
+
+ <ul>
+ <?php
+ global $wpdb;
+ $term_ids = $wpdb->get_col("
+ SELECT DISTINCT term_taxonomy_id FROM $wpdb->term_relationships
+ INNER JOIN $wpdb->posts ON $wpdb->posts.ID = object_id
+ WHERE DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= $wpdb->posts.post_date");
+
+ if(count($term_ids) > 0){
+
+ $tags = get_tags(array(
+ 'orderby' => 'random',
+ 'order' => 'DESC',
+ 'number' => 20,
+ 'include' => $term_ids,
+ ));
+ foreach ( (array) $tags as $tag ) {
+ echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . '</a></li>';
+ }
+ }
+ ?>
+ </ul>
+
+ <div style="clear: both;"></div>
+
+ </div>
- <section class="widget sidebar">
-
- <h2 class="widget-title">Popular Tags</h2>
-
- <div class="widget-container popular-tags">
-
- <ul>
- <?php
- global $wpdb;
- $term_ids = $wpdb->get_col("
- SELECT DISTINCT term_taxonomy_id FROM $wpdb->term_relationships
- INNER JOIN $wpdb->posts ON $wpdb->posts.ID = object_id
- WHERE DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= $wpdb->posts.post_date");
-
- if(count($term_ids) > 0){
-
- $tags = get_tags(array(
- 'orderby' => 'random',
- 'order' => 'DESC',
- 'number' => 20,
- 'include' => $term_ids,
- ));
- foreach ( (array) $tags as $tag ) {
- echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . '</a></li>';
- }
- }
- ?>
- </ul>
-
- <div style="clear: both;"></div>
-
- </div>
-
- </section>
+ </section>
+ <?php } ?>
<?php dynamic_sidebar( 'sidebar-signup' ); ?>