Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Micah Wood

    (@woodent)

    You would still use the the_excerpt filter, but you would check for the ps_promotion post type before editing.

    Thread Starter cliffmusic29

    (@cliffmusic29)

    Im not advanced enough to write that from scratch or where to put it… would it be something like this:

    function custom_excerpt_length( $length ) {
    return 20;
    }
    add_filter( 'the_excerpt', 'custom_excerpt_length', 20 );

    Plugin Author Micah Wood

    (@woodent)

    You would just place this code into your active theme’s functions.php file:

    function custom_excerpt_length( $length ) {
        if( 'ps_promotion' == get_post_type() ) {
    	$length = 20;
        }
        return $length;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
    Thread Starter cliffmusic29

    (@cliffmusic29)

    Thanks Micah… worked perfectly.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Promotion Slider] Control excerpt length’ is closed to new replies.