How to add correctly Post Filter

Hi,

I tried to follow your article https://premium.wpmudev.org/blog/add-post-filters/ to enable filter on blog page by custom taxonomy. Listing options for select is ok, passing values as well but I haven't arrived to modify the query, could you help me out, please?

My code in the page heading area (working fine):

<?php
		global $blog_id;

		if ( is_home() && $blog_id == 1 ) {

			?>

            <form class='post-filters'>
                <select name="produkt">
                	<option value=''>Produkt</option>
                   <?php get_option_terms( 'autodeskclub-produkt' ); ?>
                </select>
                <select name="obor">
                    <option value=''>Obor</option>
                    <?php get_option_terms( 'autodeskclub-obor' ); ?>
                </select>
                <select name="typ">
                    <option value=''>Typ</option>
                    <?php get_option_terms( 'autodeskclub-typ' ); ?>
                </select>
                <input type='submit' value='Filtruj'>
            </form>

            <?php

        }

My function, called right before get_header(); in the index.php:

function manipulate_the_query() {
	global $blog_id;
	if ( $blog_id == 1 && is_home() && ( ! empty ( $_GET['produkt'] ) || ! empty ( $_GET['obor'] ) || ! empty ( $_GET['typ'] ) )  ) {

		global $wp_query;
		$tax_query = array();		

		if( ! empty( $_GET['produkt'] ) ) {
			$tax_query[] = array(
				'taxonomy' => 'autodeskclub-produkt',
				'field'    => 'term_id',
				'terms' => $_GET['produkt']
			);
		}
		if( ! empty( $_GET['obor'] ) ) {
			$tax_query[] = array(
				'taxonomy' => 'autodeskclub-obor',
				'field'    => 'term_id',
				'terms' => $_GET['obor']
			);
		}
		if( ! empty( $_GET['typ'] ) ) {
			$tax_query[] = array(
				'taxonomy' => 'autodeskclub-typ',
				'field'    => 'term_id',
				'terms' => $_GET['typ']
			);
		}

		$modifications = array( 'tax_query' => array( 'relation' => 'AND', $tax_query ));

		$args = array_merge(
			$wp_query->query_vars,
			$modifications
		);

		query_posts( $args );	

	}
}

I will grant you access in few minutes.