Created
May 10, 2020 18:04
-
-
Save TANVIRFAZLEY/cb1d2f792c323f1476168cbb284fd6e6 to your computer and use it in GitHub Desktop.
Get custom search form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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