ID; $category = wp_get_post_terms( $post->ID, 'category' ); $category_id = !empty( $category[0]->term_id ) ? $category[0]->term_id : ''; $category_name = !empty( $category[0]->name ) ? $category[0]->name : ''; $colors = news_unlimited_cat_colors(); $data = array(); $show_sidebar = get_theme_mod( 'show_sidebar_checkbox' , true ); $post_num = 2; if ( $show_sidebar != true) { $post_num += 1; } $comments_count = wp_count_comments($post->ID); ?>

post_author ); ?> | | total_comments); ?> '; } $numItems = count($category); $j = 0; foreach ($category as $key => $value) { if( !array_key_exists( $value->name , $data)){ $data[ $value->name ] = $colors[0]; $cat_id = $value->term_id; unset( $colors[0] ); $colors = array_values( $colors ); }?> name ); ?>

', ' ', '
' ); ?>
'post', 'post_status' => 'publish', 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $category_id, ), ), 'post__not_in' => array($not_post), 'posts_per_page' => $post_num ); $args = apply_filters( 'news_unlimited_single_page_related_post', $args ); $related_post = new WP_Query( $args ); $count = 0; if( $related_post->have_posts() ): ?>

have_posts() ): $related_post->the_post(); $comments_count = wp_count_comments($post->ID); if( $count == 0 ){ ?> "; endif; ?>