Changin gthe excerpt length based on page
-
Hi,
I’ve been trying to change the excerpt on some articles based on a page, so for example the home page has 60 words, a sub section has 20 words. I know i’m doing something wrong here, but i’m not sure what. I’m not a programmer, and it shows. lol. But yeah, any suggestions would be welcome. ??
<?php function new_excerpt_length($length) { if (is_page ('whoscoming')) { $length = 20; }else { $length = 60; } } add_filter('excerpt_length', 'new_excerpt_length'); ?>
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Changin gthe excerpt length based on page’ is closed to new replies.