• Is it possible to return the result of comments_number with words rather than numerals? I hate seeing numerals for numbers under 100, and I’d much rather it say: “nine responses have been left so far” than “9 responses.”

    Is there a way? A plugin, perhaps?

Viewing 5 replies - 1 through 5 (of 5 total)
  • there is a way for that, but it might be very work-intense …
    all you’ll need is a txt file that looks like this:

    one
    two
    three
    four
    .
    .
    .

    when you have done that (i recommend you go til twothousandfourhundredandsixtyseven ;)) just post again and i tell you the next step (that is much easier – insert a scrap of code into the foreach-loop within comments.php )

    so, what to say? till later 😉

    still busy? Lo0o0o0o0o0o0o0o0o0oo00o0o0o00o0o0oL !!
    i can wait…

    Thread Starter ashuttleworth

    (@ashuttleworth)

    Haha, OK, what’s the next step? I can handle the TXT part.

    you need the following:

    <?php $word-number = file(‘written-numbers.txt’); ?>

    this reads the txt file but does no output in the doc. therefore you use a foreach-loop (that you have to place within the already existing loop of your comments.php):

    <?php
    //get each lines content of the txt
    foreach ($word-number as $value) {
    // output each lines content
    echo “$value”;
    }
    ?>
    if you want or need to you could also make the echo-line look like this echo “$value … see what i’m heading at? ok 🙂
    kind regards (if you have problems -i didnt test it my own- or wanna let me see the result, post again – or a link 🙂 thx )

    the alternate echo-line should have looked like:
    echo "<p class=\"comment-count\">$value</p>";
    i should have used code :-/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘comments_number with words rather than numerals?’ is closed to new replies.