Correct reset rewrite rule in WordPress

Check realtime without reactivation plugin or theme

add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );
add_filter( 'query_vars','my_insert_query_vars' );
add_action( 'wp_loaded','my_flush_rules' );

// flush_rules() if our rules are not yet included
function my_flush_rules(){
	$rules = get_option( 'rewrite_rules' );

	if ( ! isset( $rules['(project)/(\d*)$'] ) ) {
		global $wp_rewrite;

// Adding a new rule
function my_insert_rewrite_rules( $rules )
	$newrules = array();
	$newrules['(project)/(\d*)$'] = 'index.php?pagename=$matches[1]&id=$matches[2]';
	return $newrules + $rules;

// Adding the id var so that WP recognizes it
function my_insert_query_vars( $vars )
    array_push($vars, 'id');
    return $vars;

Reset rewrite rules after deactivate plugin

register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );

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');