Answers for "wordpress truncate text"

PHP
0

wordpress truncate text

echo wp_trim_words( get_the_content(), 100 ); // post content
echo wp_trim_words( get_the_excerpt(), 100 ); // post excerpt
echo wp_trim_words( get_the_title(), 100 ); // post title
Posted by: Guest on March-22-2021
0

wordpress truncate text

<?php
$my_content = apply_filters( 'the_content', get_the_content() );
$my_content = wp_strip_all_tags($my_content);
echo wp_trim_words( $my_content, 55, $moreLink);
?>
Posted by: Guest on March-22-2021

Browse Popular Code Answers by Language