$field->words()

Returns the number of words in the text

  • return (integer)

Example

<?php echo $page->text()->kirbext() ?>

<dl class="text-stats">

  <dt>Characters</dt>
  <dd><?php $page->text()->length() ?></dd>

  <dt>Words</dt>
  <dd><?php $page->text()->words() ?></dd>

</dl>