How to display search box in a page
  • nnagarajan7nnagarajan7 February 21

    HI,

    I could not find an appropriate section to post my query and hence had to open a new discussion.

    I have a weird query. I want to display search box in a page i.e. only a search box and no other contents. The idea is to make this as my index page (something similar to google.com) where only search box will appear. I hope someone will have an answer to this.

  • cbavotacbavota February 23

    You will have to create a new page template in the theme directory and code it so that only a search box appears:

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

  • nnagarajan7nnagarajan7 February 23

    Hi,

    But how do I display it on a wordpress page? Say I want to incorporate it in the index page.

    I am able to do this for Google customized search by pasting the code in the index.php after removing the code calling template from index.php. However, in this case the search results are not appearing within my site.

  • cbavotacbavota February 24

    The function in WordPress to display a search box is get_search_form().

    http://codex.wordpress.org/Function_Reference/get_search_form

Hey there!

Take a look around, and if you would like to add a comment or start a discussion, register by clicking on the button below.

Register

Categories

In this Discussion

Tagged