Snippets: Insert Search Form into the Page Header Title Area

This code will insert a searchform into the default theme's page header title area (where the title and breadcrumbs normally are located). The search form will be inserted after the title and breadcrumbs. You can then use a little CSS to position it as wanted.

add_action( 'wpex_hook_page_header_inner', function() {
	echo '<div class="my-page-header-search">' . get_search_form( array( 'echo' => false ) ) . '</div>';
}, 20 );
All PHP snippets should be added via a child theme's functions.php file.