Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
  • in reply to: Limit the excerpt length #38475
     exenewyorker
    Participant

    Tried the code above and it completely removed the excerpt in the archive-porfolio view. Also tried the following in the kleo-child functions.php to change the excerpt to word limit instead of characters and nothing changed:

    COPY CODE
    if ( ! function_exists( 'kleo_excerpt' ) ) {
    	function kleo_excerpt( $limit = 15 ) {
            if ( $chars ) {
                $excerpt = explode( ' ', get_the_excerpt(), $limit );
                if ( count( $excerpt ) >= $limit ) {
                    array_pop( $excerpt );
                    $excerpt = implode( " ", $excerpt ) . '...';
                } else {
                    $excerpt = implode( " ", $excerpt ) . '';
                }
                $excerpt = preg_replace( '<code>\[[^\]]*\]</code>', '', $excerpt );
                return '<p>' . $excerpt . '</p>';
            } else {
                $excerpt = get_the_excerpt();
                return '<p>'. substr( $excerpt, 0, $limit ) . ( strlen( $excerpt ) > $limit ? '...' : '' ) . '</p>';
            }
    	}
    }
Viewing 1 post (of 1 total)

Log in with your credentials

Forgot your details?