要修改wordpress裡的the_excerpt()的預設長度,可以在functions.php裡面加入以下:
1 2 3 4 |
function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
參考:
AWS、PHP、LINUX、APACHE、MYSQL、CAKEPHP、JAVASCRIPT…….
要修改wordpress裡的the_excerpt()的預設長度,可以在functions.php裡面加入以下:
1 2 3 4 |
function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
參考: