WordPress.org

Ready to get started?Download WordPress

Forums

Adding Search form to a static page with no side bar? (5 posts)

  1. spanishben
    Member
    Posted 7 years ago #

    Hi, I am running wp 2.2 and want to use the static homepage option. This page will have no sidebar. When I try to include the normal <?php include (TEMPLATEPATH . '/searchform.php'); ?> (that puts the search box in the sidebar) in the page, nothing happens. No search box appears. So how can I include a search box in normal page?

    Thanks in advance for any help.

  2. Jeremy Clark
    Moderator
    Posted 7 years ago #

    Copy the contents of your searchform.php and paste it here (click the link). Then report back the link to the code.

  3. spanishben
    Member
    Posted 7 years ago #

  4. Jeremy Clark
    Moderator
    Posted 7 years ago #

    Duh sorry I misread your question. You can't use php code on a post or page. What you'll have to do is create a new template for that page and add the code there. Have a look here for some help on template design.

  5. spanishben
    Member
    Posted 7 years ago #

    Thanks! You led me to the right solution, using a custom page template based on what I found on this page on search page templates. Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic