Change Post Order to Last Modification Date

If you want to list the posts in your blog view ordered by last modified date (in descending order), you can use this snippet:

add_action( 'pre_get_posts', function ( $query ) {
	if ( $query->is_home() && $query->is_main_query() ) {
		$query->set( 'orderby', 'modified' );
		$query->set( 'order', 'DESC' );
	}
} );