WordPress has a inbuilt search form to search content on the website. In this tutorial we will learn how we can add WordPress core search form in a theme.
Search Form Code
Just add below code in your theme template file where you wish to show search form and it will show WordPress core search form.
1 | <?php get_search_form(); ?> |
You will get default search form, something like this:
Hide Search Form Label
If you want to hide the search form label text Search for:, just add below css code in style.css of your theme.
1 2 3 | .screen-reader-text { display: none; } |