Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Trimming Manual Excerpt

  • Yes, we can add a condition to make it only work for the podcast:

    add_filter( 'get_the_excerpt', function( $excerpt, $post ) {
        if ( ! is_single() && get_post_type( $post ) === 'podcast' ) {
            $excerpt_length = 20;
            $excerpt_more   = apply_filters( 'excerpt_more', ' ' . '→' );
            $excerpt        = wp_trim_words( $excerpt, $excerpt_length, $excerpt_more );
        }
        return $excerpt;
    }, 99, 2 );
  • Amazing thank you Ying! Closing this topic now, very happy with this result.

  • Glad to hear that 🙂

Viewing 3 posts - 17 through 19 (of 19 total)
  • You must be logged in to reply to this topic.