WordPress.org

Ready to get started?Download WordPress

Forums

1.comment , 2.comment ?? (4 posts)

  1. imlech
    Member
    Posted 9 years ago #

    how can i show in comments page like this style

    http://www.stopdesign.com/log/2004/11/09/symbolic-java.html#comments
    1 comment , 2.comment ...
    with not ul or li .. i want to use only wp comments tag .. which tag ??

    //sorry for my bad english.

  2. lyklev
    Member
    Posted 9 years ago #

    What you should probably do is create a counter variable.

    I use the default theme as example, but you should get the idea.

    In wp-content/themes/default, you should edit the file comments.php.
    Right above the comments loop, visible with foreach ($comments as $comment), remove the ol, so it won't be a list, and define the counter in php:
    <?php $comment_counter = 1; ?>

    Now at the start of your comment, use something like

    <?php echo "Comment number $comment_counter"; ?>

    and after that, increase the comment number by one:
    <?php $comment_counter = $comment_counter + 1; ?>

    Really simple programming, actually.

    Don't forget to remove all the ol and li tags, and closing tags.

  3. Minna
    Member
    Posted 9 years ago #

    using lists (ordered list, <ol>) is the easiest way to get your comments numbered. You have in your stylesheet:
    .commentlist li {
    margin: 15px 0 3px;
    padding: 5px 10px 3px;
    list-style: none;
    }

    That last line, list-style, is making the comments appear with no list bullet (that is, no number). If you remove that line, it'll make the numbering show up, so you can see if that's what you'd like.

  4. imlech
    Member
    Posted 9 years ago #

    @lyklev , thank you so much.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.