Wednesday, January 28, 2015

excerpt or read more text cut program

$content=get_the_content();
$words = explode(" ", $content);
$first = join(" ", array_slice($words, 0, 50));
echo $first;

No comments:

Post a Comment

Wordpress debug log function

Wordpress error log code: if ( ! function_exists ( 'write_log' ) ) { function write_log ( $data ) { if ( defined ( '...