How To Keep Search Title the same on paged Results

The problem is here:

if( get_post_type()=='page' || is_single() ){
    echo '<h1 class="h2">'. $post->post_title .'</h1>';
}

get_post_type() is using the global $post, which will contain the first post in your result set. If this is a page, then your other conditions will never be tested and you’ll never reach the is_search() test.

Use is_page() instead:

if( is_page() || is_single() ){
    echo '<h1 class="h2">'. wp_title( '', false ) .'</h1>';
}

or, use is_singular(), which will be true for page, post, or attachment, or any singular post type:

if( is_singular() ){
    echo '<h1 class="h2">'. wp_title( '', false ) .'</h1>';
}

tech