WordPress.org

Ready to get started?Download WordPress

Forums

Commenters are anonymous on home page, but ok elsewhere (2 posts)

  1. AndrewKantor
    Member
    Posted 8 years ago #

    Hey, all -- I've found similar problems to this, but none exactly.

    I'm using 2.0.4 and just imported my blog and comments from Movable Type. I created my own theme so WordPress basically powers my site.

    On my home page, I have a section that lists the latest 20 comments to any entry on the blog. I get this using a template I called "latest-comment.php."

    Problem: Every commenter there is listed as Anonymous. But if you go to the entry itself, all the commenters are listed correctly -- it's only in the latest-comment file that they're all Anonymous.

    Here's the code from my latest-comments.php:

    <?php rewind_posts(); ?>
    <!-- WHILE THERE ARE FEWER THAN 20 ENTRIES, KEEP LOOPING -->
    <?php $my_loopcount = 0; ?>
    <?php if (have_posts()) : while ((have_posts()) && ($my_loopcount < 21)) : the_post(); ?>
    <?php $my_loopcount++; ?>

    <p style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size:11px;">
    <b>
    In [a href=" <?php the_permalink(); ?> "]<?php the_title(); ?></b>

    From <?php comment_author_link() ?>

    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    (Note: I put one link in square brackets so it appeared properly here.)

    * * *

    You can see the result (the site in progress) at http://www.kantor.com/wordpress.

    Any ideas would be more than welcome. Thanks!

    Andrew

  2. AndrewKantor
    Member
    Posted 8 years ago #

    Oh, and I should mention that I tried both comment_author_link() and comment_author(). No luck.

Topic Closed

This topic has been closed to new replies.

About this Topic