Changing Excerpt length by plugin
-
Hi, I’m working on a gallery plugin which will feature a short excerpt for each post at the moment I’m setting the excerpt length like this:
function custom_excerpt_length ( $length ) { global $post; if ($post->post_type == 'gallery') { return 10; } else { return 55; } } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
I would like to change this so it only changes the excerpt length for my gallery post type and leaves any previously defined lengths alone. Forgive me if I missed this when I searched, but could anyone point me in the right direction, thanks.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Changing Excerpt length by plugin’ is closed to new replies.