Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step 01: use the code where needed and to style it properly follow the step 02
- <?php get_search_form(); ?> <!--this function will look for searchform.php file-->
- Step 02: create a new file as 'searchform.php' and dynamic the html code there
- Your HTML code was this:
- <form action="" id="search-form" method="get">
- <input type="text" value="search" onblur="if(this.value=='')this.value='search'" onfocus="if(this.value=='search')this.value=''" />
- <input type="hidden" value="submit" />
- </form>
- Now your dynamic code in searchform.php will be like this:
- <form action="<?php home_url(); ?>" id="search-form" method="get">
- <input type="text" value="search" name="s" id="s" onblur="if(this.value=='')this.value='search'" onfocus="if(this.value=='search')this.value=''" />
- <input type="hidden" value="submit" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement