Page Header for search results

When using a header element you might want to display the search terms inside the header.

You would, first, need to create a shortcode for it:

add_shortcode( 'search', 'tu_search_shortcode' );
function tu_search_shortcode() {
    ob_start(); ?>
        Search results for: <?php echo get_search_query(); ?>
    <?php
    return ob_get_clean();
}

Then, display it using the [search] shortcode.

So, if for example, you search for generatepress, your search terms will be displayed in the form of Search results for: generatepress inside your header element.