• I have modified my comments so that the list is hidden and the comment_ID is pulled and used for numbering so that i can style the numbers better.
    The problem I am having is that my comments numbers are starting at 34 for everypost, rather than starting at 1.
    any ideas?
    here is the loop code I am using:
    <ol id="commentlist">
    <?php foreach ($comments as $comment) : $i++; ?>
    <li id="comment-<?php comment_ID() ?>" <?php if ($i % 2) echo "class='alt'"; ?> >
    <span><?php echo $i; ?></span> <?php comment_author_link() ?> left a <?php comment_type(); ?>
    <?php comment_text() ?>
    <?php comment_date() ?> @ "><?php comment_time() ?>
    <?php edit_comment_link(__("Edit This"), ' |'); ?>

    <?php endforeach; ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can try putting this in your css:
    #commentlist ul, #commentlist li {
    list-style-type: none;
    }

    That takes away the numerical order in the ol.

    Thread Starter kcomphlint

    (@kcomphlint)

    I don’t think this has anything to do with the CSS, but rather the loop itself.
    You can see what I am talking about by looking at a post with multiple comments on my site. For instance, this post has 9 comments, but they are numbered 34 – 43.

    Thread Starter kcomphlint

    (@kcomphlint)

    Yeah, I got it fixed this afternoon. Should have posted.
    Basically, I just had to set $i = 0 so that the loop knew which number to start at.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Comment loop not working right’ is closed to new replies.