Excerpt in Twenty Seventeen

The new version of WP appeared very interested theme Twenty Seventeen.

But for me need blog style with excerpts without full content.

And I created child theme and added code in functions.php

function the_content_loop_trim($content){

  if(is_archive() or is_home()){
    $post = get_post();
    $content = $post->post_content;
    $url = get_permalink($post->ID);
    $more = sprintf(' <a href="%s">...</a>', $url);
    $excerpt = wp_trim_words( $content, $num_words = 30, $more);
    $content = $excerpt;
  }

  return $content;
}
add_filter('the_content', 'the_content_loop_trim');