[Plugin: WordPress MU Sitewide Tags Pages] Comment numbers (9 posts)

  1. jimmcq
    Posted 6 years ago #

    In the "WordPress MU Sitewide Tags Pages" plugin it doesn't seem to keep comment counts of the user's posts synced up on the central blog.

    If a user gets a few comments on a post, I was hoping that this number would be reflected when viewing the posts (either via a theme or feed) in the "central blog". Does this make sense?


  2. patung
    Posted 6 years ago #

    "Does this make sense?"

    Yes, and I second your request.

  3. gmb3
    Posted 6 years ago #

    Has anyone found a workaround for this? Having updated comment counts would be very useful. Please post if so.

  4. adywp
    Posted 6 years ago #

    me... need this one too

  5. adywp
    Posted 6 years ago #

    Found this resource, but dont know how to implement


  6. David Sader
    Posted 6 years ago #

    I have the following copy 'n pasted into the sitewide tags plugin(v0.4.0.1) and comment counts show as expected.

    function ds_sitewide_tags_get_comments_num($count) {
      global $blog_id, $wpdb, $post;
      	$tags_blog_id = get_site_option( 'tags_blog_id' );
      	if( !$tags_blog_id || $blog_id != $tags_blog_id ) return $count;
      	list( $post_blog_id, $post_id ) = explode( '.', $post->guid );
      	$base = $wpdb->get_blog_prefix( $post_blog_id );
      	$r = $wpdb->get_col( "SELECT comment_count FROM {$base}posts WHERE ID=$post_id" );
     	if( is_array( $r ) ) return $r[0] + $count;
      return $count;
    add_filter('get_comments_number', 'ds_sitewide_tags_get_comments_num');
  7. David Sader
    Posted 6 years ago #

    Adding the above function only the the functions.php of the theme active on the main blog is better, then it'll only fire there instead of on every comment form in the network.

  8. patung
    Posted 6 years ago #

    I tried that, for some reason it shows "Comments Off" on the tags blog though.

    Also, unrelated to comments, the title of the post doesn't show on the tags blog, it's Twenty Ten theme.

  9. jtcreate
    Posted 5 years ago #

    I'm trying to get this to work as well. I've got a mod of the Twenty Ten theme and with the code in, I'm still seeing comments off. Any suggestions? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic