Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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
Comment

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);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: carbon parse timestamp 
Php :: Format and show date PHP 
Php :: serve in localhost using php 
Php :: check type in php 
Php :: php array all keys empty 
Php :: laravel route resources 
Php :: php month single digit 
Php :: smtp php test 
Php :: symfony 5 server start php bin cosleole 
Php :: magento 2 print php error 
Php :: return last inserted id in laravel 
Php :: how to save file in storage folder in laravel 
Php :: validation not exists with this id laravel 
Php :: php foreach 
Php :: php sql get single value 
Php :: minus 1 year php 
Php :: phpoffice create excel and download 
Php :: if condition inside echo in php 
Php :: laravel count by date 
Php :: symfony server start port 
Php :: php remove array element reset keys 
Php :: php split array in half 
Php :: php run command line 
Php :: eloquent whereraw 
Php :: laravel wher in 
Php :: php get first element of array 
Php :: continue not in the loop or switch 
Php :: LARAVEL CREAT NEW TEST 
Php :: check variable type in php 
Php :: php get value from url 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =