wordpress truncate text

Solutions on MaxInterview for wordpress truncate text by the best coders in the world

showing results for - "wordpress truncate text"
Federica
04 Apr 2016
1echo wp_trim_words( get_the_content(), 100 ); // post content
2echo wp_trim_words( get_the_excerpt(), 100 ); // post excerpt
3echo wp_trim_words( get_the_title(), 100 ); // post title
4
Riccardo
26 Jan 2021
1<?php
2$my_content = apply_filters( 'the_content', get_the_content() );
3$my_content = wp_strip_all_tags($my_content);
4echo wp_trim_words( $my_content, 55, $moreLink);
5?>
6