Title: [Plugin: Alkivia SidePosts] Add comments count?
Last modified: August 19, 2016

---

# [Plugin: Alkivia SidePosts] Add comments count?

 *  [Tosh](https://wordpress.org/support/users/xberserker/)
 * (@xberserker)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-alkivia-sideposts-add-comments-count/)
 * Love the widget, great work! one thing I wish it had was how many comments the
   post has or doesn’t have.
 * [http://wordpress.org/extend/plugins/sideposts/](http://wordpress.org/extend/plugins/sideposts/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Tosh](https://wordpress.org/support/users/xberserker/)
 * (@xberserker)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-alkivia-sideposts-add-comments-count/#post-1443106)
 * Ok, I got it to work 🙂 This is what my /wp-content/plugins/sideposts/templates/
   posts.php looks like
 *     ```
       global $more, $post;
   
           $current = 0;
       	$total = $query->post_count;
   
           while ( $query->have_posts() ) {
       	    $query->the_post();
               ++$current;
   
       		echo '<li' . ak_sposts_post_class($current, $total) . '>';
       		echo '<span class="sideposts-title"><a href="'. get_permalink() .'">'. get_the_title() .'</a></span>';
   
       // Comment Count
       $commentscount = get_comments_number();
       if($commentscount == 1): $commenttext = 'comment'; endif;
       if($commentscount > 1 || $commentscount == 0): $commenttext = 'comments'; endif;
       // End Comment Count
   
       		$date_string = '<span class="sideposts_date">'. mysql2date(get_option('date_format'), $post->post_date) .'</span>';
       		echo '<br />' . apply_filters('ak_' . $i18n . '_date',  $date_string);
       		// Comment Count
       		echo '<span class="sideposts_date"> | '.$commentscount.' '.$commenttext.'</span>';
   
       		// Show Full post.
       		$more = false;
       		the_content('<p>' . __('Read more &raquo;', $i18n) . '</p>');
   
               echo '</li>' . PHP_EOL;
       	}
       ```
   
 * Would it be possible to have the widget title, link to the category archive?

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Alkivia SidePosts] Add comments count?’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * 1 reply
 * 1 participant
 * Last reply from: [Tosh](https://wordpress.org/support/users/xberserker/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/plugin-alkivia-sideposts-add-comments-count/#post-1443106)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
