WordPress Custom Search Form

/** * Custom Search Form ************************************************************************ */ $form = '<form method="get" class="search-form" action="' . home_url( '/' ) . '" > <div class="relative"> <input class="search-field" type="text" value="' . get_search_query() . '" placeholder="Search" name="s" /> <button type="submit" class="search-submit absolute"><i class="fa fa-search"></i></button> </div> </form>'; return $form; add_filter( 'get_search_form', 'custom_search_form' );
Basic rewrite of the get_search_form() function to allow custom search forms.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.