Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Created February 17, 2020 08:19
Show Gist options
  • Save thecodepoetry/742b84f7eb4f876fc1b67d2122207788 to your computer and use it in GitHub Desktop.
Save thecodepoetry/742b84f7eb4f876fc1b67d2122207788 to your computer and use it in GitHub Desktop.
The7 search shortcode
function the7searchform( $form ) {
$form = '<form class="searchform" role="search" method="get" action="'.esc_url( home_url( "/" ) ).'">
<label for="the7-search" class="screen-reader-text">'.esc_html( "Search:", "the7mk2" ).'</label>
<input type="text" id="the7-search" class="field searchform-s" name="s" value="'.esc_attr( get_search_query() ).'" placeholder="'.esc_attr( "Type and hit enter …", "the7mk2" ).'" />
<input type="submit" type="submit" id="searchsubmit" value="'.esc_attr( "Search!", "the7mk2" ).'" class="searchsubmit default-btn-shortcode dt-btn dt-btn-s link-hover-off btn-inline-left " style="position:absolute;" />
</form>';
return $form;
}
add_shortcode('the7search', 'the7searchform');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment