WordPress.org

Ready to get started?Download WordPress

Forums

numbered list on comments without period after number (8 posts)

  1. stephenrusselcrane@yahoo.com
    Member
    Posted 2 years ago #

    I know that I can use the ordered list function built into wordpress to display all the comments with numbers next to them. This may seem totally useless to anyone else but I want that ordered list to not have a period after the number displayed. I wrote up a php script in my functions.php but am running into issues. I put this bit of code in my comments.php file <?php wp_list_comments('type=comment&callback=ninja_comment'); ?> this points to this block of code in my functions.php ` $x= get_comments_number();
    for ($i=1; $i<=$x; $i++)
    {
    echo "<div class='comment_number grid_2 push_5'>".$i."</div>";

    }`
    It worked great until i entered multiple replies to posts. Any thoughts?

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    It worked great until i entered multiple replies to posts

    what is the problem now?

    what numbering system do you want to have if there are multiple replies to comments in various depth levels?

  3. stephenrusselcrane@yahoo.com
    Member
    Posted 2 years ago #

    The problem right now is every post is preceded by a list of numbers. Instead of outputing one number per post I get a whole slew of numbers. Lets say there are three replies to a post, then every comments has 1 2 3 posted before the comment.

  4. stephenrusselcrane@yahoo.com
    Member
    Posted 2 years ago #

    here is a link to see the problem.

  5. alchymyth
    Forum Moderator
    Posted 2 years ago #

    it might help if you paste the full code of the callback function 'ninja_comment()' into a http://pastebin.com/ and post the link to it here - how-to: http://codex.wordpress.org/Forum_Welcome#Posting_Code

    how would you expect that the numbers show?

  6. stephenrusselcrane@yahoo.com
    Member
    Posted 2 years ago #

    here's a link to pastebin for the whole function. Also, here's a link to how i want the page to look.

  7. stephenrusselcrane@yahoo.com
    Member
    Posted 2 years ago #

    Just to clarify, a link to how i want the page to look is Here. A link to the problem is Here. When there is more then one reply I get all tripped up...

  8. alchymyth
    Forum Moderator
    Posted 2 years ago #

    http://pastebin.com/VuMiVdiU

    this should just add the running number;
    no special number formats for replies of various depths, nor for paginated comments.

Topic Closed

This topic has been closed to new replies.

About this Topic