Skip to the content

nano.cat

Snippets of Mălin Cenușă

  • Home
  • Categories
  • Malware Samples
  • mălin.ro
  • blackhat.pm
  • palma.solutions

Adjust excerpt length in WordPress

Date: May 9, 2020
Tags: excerpt length, functions.php, PHP, programming, Wordpress
Categories: CMS, PHP, Programming & Scripting, Wordpress

Add this to functions.php to achieve it:

function mytheme_custom_excerpt_length( $length ) {
return 20;
}
add_filter( ‘excerpt_length’, ‘mytheme_custom_excerpt_length’, 999 );

…

[root@nano.cat]# Check it out!

Categories



© 2021 nano.cat. All rights reserved. Powered by WordPress.