Skip to content

Instantly share code, notes, and snippets.

@TANVIRFAZLEY
Created May 10, 2020 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save TANVIRFAZLEY/cb1d2f792c323f1476168cbb284fd6e6 to your computer and use it in GitHub Desktop.
Save TANVIRFAZLEY/cb1d2f792c323f1476168cbb284fd6e6 to your computer and use it in GitHub Desktop.
Get custom search form
<?php
//MORUS SEARCH
function morus_search_form() {
$home_url = esc_url( get_home_url( '/' ) );
$value = esc_attr( get_search_query() );
$lable = __( 'Search', 'morus' );
$form = <<<FORM
<form action="{$home_url}" method="GET">
<input name="s" value="{$value}" type="text" placeholder="{$lable}" class="form-control" id="search_input">
<button type="submit" class="search_icon"><i class="ion-ios-search-strong"></i></button>
</form>
FORM;
return $form;
}
add_action( 'get_search_form', 'morus_search_form' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment