March 17, 2017
Limit the number of words in a post excerpt and add “Read more”
Description:
1. read more
2. number of words
Kind:
PHP
PHP:
function new_excerpt_more($more) { global $post; return '… ID) . '">' . 'Read More!' . ''; } add_filter('excerpt_more', 'new_excerpt_more');
function my_excerpt_length($length) { return 30; // Or whatever you want the length to be. } add_filter('excerpt_length', 'my_excerpt_length');