Advertisement
kobial8

Search Form Dynamic

Feb 21st, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.82 KB | None | 0 0
  1. Step 01: use the code where needed and to style it properly follow the step 02
  2. <?php get_search_form(); ?> <!--this function will look for searchform.php file-->
  3.  
  4. Step 02: create a new file as 'searchform.php' and dynamic the html code there
  5. Your HTML code was this:
  6. <form action="" id="search-form" method="get">
  7.      <input type="text" value="search" onblur="if(this.value=='')this.value='search'" onfocus="if(this.value=='search')this.value=''" />
  8.     <input type="hidden" value="submit" />
  9.  </form>
  10.  
  11. Now your dynamic code in searchform.php will be like this:
  12.  <form action="<?php home_url(); ?>" id="search-form" method="get">
  13.      <input type="text" value="search" name="s" id="s" onblur="if(this.value=='')this.value='search'" onfocus="if(this.value=='search')this.value=''" />
  14.      <input type="hidden" value="submit" />  
  15.  </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement