WordPressFunction : wp_trim_words()


Syntax

  • <?php $trimmed_text = wp_trim_words( $text, $num_words = 55, $more = null ); ?>

Parameters

ParameterDetails
$text(String) (Required) Text that will be shortened or trimmed.
$num_words(Integer) (Required) Number of words to which text will be restricted.
$more(String) (Optional) What to append if $text needs to be trimmed.