Created
April 4, 2014 09:21
-
-
Save michaeloeser/9971085 to your computer and use it in GitHub Desktop.
Modify the excerpt lenght (Wordpress default is 55 words)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//modify the excerpt lenght (Wordpress default is 55 words) | |
add_filter('excerpt_length', 'my_excerpt_length'); | |
function my_excerpt_length($length) { | |
if (is_archive()) { | |
return 55; // This is the number of words in archive pages (e.g. category overview). | |
} else { | |
return 55; // This is the number of words in all other excerpts | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment