The MU forums have moved to WordPress.org

Comments not showing in admin panel (14 posts)

  1. aaron_guitar
    Member
    Posted 15 years ago #

    After the upgrade to 1.5.1 comments aren't being listed in the admin panel. The comments link shows that there's a comment needing to be moderated but when I click the link it says that there are no comments. However, when I go to Manage > Posts and click the icon in the comments column they show up and I can moderate them there. I set the WP_CACHE and ENABLE_CACHE globals to false in the wp-config file but that didn't change anything.

  2. cafespain
    Member
    Posted 15 years ago #

    aaron - I had this very same problem.
    Check your current comments table (wp_xx_comments ) and make sure you have an index called comment_date_gmt on the comment _date_gmt field.

    If you haven't then add one and it should work again.

    I think this only affects updated blogs, as all the new ones I've created since the upgrade seem to work correctly.

  3. aaron_guitar
    Member
    Posted 15 years ago #

    Cafespain -

    I looked at the wp_xx_comments table and there was already an index on the comment_date_gmt field. It was named idx_wp_2_comments_date_gmt and I renamed it to comment_date_gmt and it still doesn't work.

    I wonder if this is related to this problem: http://mu.wordpress.org/forums/topic.php?id=8220

    Any other ideas?

  4. cafespain
    Member
    Posted 15 years ago #

    Run this query in phpmyadmin (or however you access your mysql database) and see what it comes up with (obviously change $wpdb->comments below for the name of your comments table):

    SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE ( comment_approved = '0' OR comment_approved = '1' ) ORDER BY comment_date_gmt DESC LIMIT 0, 20

  5. aaron_guitar
    Member
    Posted 15 years ago #

    I'm a dummy. I had renamed it to comments_date_gmt instead of comment_date_gmt. Thanks for your help!

  6. tracker
    Member
    Posted 15 years ago #

    Shot in the dark, as this thread is a bit old.

    I have just exported my wordpress.com details to my own host but only comments are allowed on the Homepage! Now it is possible that this is a fault of the theme but how do I edit it?

    I have exported 3 comments over and they show uo in teh admin cpanel and I can edit them etc but they won't show up on the page.

    Any help would be great.

  7. andrea_r
    Moderator
    Posted 15 years ago #

    It's the theme. Switch themes to check this, for starters.

  8. tracker
    Member
    Posted 15 years ago #

    andrea,

    Thankf for the reply.

    Yes it is the theme and the comments can be enabled. How do I know this? Well I was messing about trying to follow your advice and I had it all sorted! Comments allowed and shown. But after trying to install a plugin - and doing it badly - I couldn't gain access to the site and had to reinstall it again now I don't know what I did or how I managed to get theme to allow comments so I can't replicate it.

    Can you lend me your devine knowledge?

    Thanks

  9. andrea_r
    Moderator
    Posted 15 years ago #

    Can you turn off the plugin you reinstalled?
    Did you check your error logs?

  10. tracker
    Member
    Posted 15 years ago #

    Yes all plugins are deactivated and indeed uninstalled.

    Comments are allowed on the main "Home" page but none other.

  11. tracker
    Member
    Posted 15 years ago #

    This is the comments.php file:

    <?php
    /**
    * @package WordPress
    * @subpackage Default_Theme
    */

    // Do not delete these lines
    if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');

    if ( post_password_required() ) { ?>
    <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
    <?php
    return;
    }
    ?>

    <!-- You can start editing here. -->

    <?php if ( have_comments() ) : ?>
    <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</h3>

    <div class="navigation">
    <div class="alignleft"><?php previous_comments_link() ?></div>
    <div class="alignright"><?php next_comments_link() ?></div>
    </div>

    <ol class="commentlist">
    <?php wp_list_comments(); ?>

    <div class="navigation">
    <div class="alignleft"><?php previous_comments_link() ?></div>
    <div class="alignright"><?php next_comments_link() ?></div>
    </div>
    <?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post->comment_status) : ?>
    <!-- If comments are open, but there are no comments. -->

    <?php else : // comments are closed ?>
    <!-- If comments are closed. -->
    <p class="nocomments">Comments are closed.</p>

    <?php endif; ?>
    <?php endif; ?>

    <?php if ('open' == $post->comment_status) : ?>

    <div id="respond">

    <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3>

    <div class="cancel-comment-reply">
    <small><?php cancel_comment_reply_link(); ?></small>
    </div>

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be /wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in to post a comment.</p>
    <?php else : ?>

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

    <?php if ( $user_ID ) : ?>

    <p>Logged in as /wp-admin/profile.php"><?php echo $user_identity; ?>. " title="Log out of this account">Log out »</p>

    <?php else : ?>

    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>

    <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

    <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small>Website</small></label></p>

    <?php endif; ?>

    <!--<p><small>XHTML: You can use these tags: <?php echo allowed_tags(); ?></small></p>-->

    <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>

    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <?php comment_id_fields(); ?>
    </p>
    <?php do_action('comment_form', $post->ID); ?>

    </form>

    <?php endif; // If registration required and not logged in ?>
    </div>

    <?php endif; // if you delete this the sky will fall on your head ?>

  12. tracker
    Member
    Posted 15 years ago #

    andrea,

    I sorted it out!!

    Had to add the following line to the page.php code:

    <?php comments_template(); ?>

    That's all it took.

    Thanks anyway.

  13. andrea_r
    Moderator
    Posted 15 years ago #

    You didn't say specifically that it was on pages (which are different than posts)

    Some themes have removed that call on the page template on purpose.

  14. tracker
    Member
    Posted 15 years ago #

    Yeah I didn't, my apologies!

    Thanks again though at least you acknowledged my plea ;)

About this Topic

  • Started 15 years ago by aaron_guitar
  • Latest reply from tracker