Site logo

Archived topic

Change post lenght

5 replies · Started by albabes on July 29, 2022

Viewing posts 1–6 of 6

I'm using this code below in the popular plugin, "Code Snippets". I'm using the "Run snippet everywhere" option.
I want my posts to show fewer words than the default 55 words. But its not working. https://dbsatucson.org
Ideas anyone?

function my_excerpt_length($length){
return 40;
}
add_filter(‘excerpt_length’, ‘my_excerpt_length’);

Hi there,

you can adjust the excerpt length in Customizer > Layout > Blog

Thanks David. So is that "very common code" just not compatible with GP? I read it doesn't work on TWENTY themes either?

Thanks David and Ying

This archived topic is closed to new replies.