WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Alkivia SidePosts] Add comments count?

[Plugin: Alkivia SidePosts] Add comments count?

Viewing 1 replies (of 1 total)
  • 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.
Skip to toolbar