Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End help getting code to work in wordpress

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24787
    cybershot
    Participant

    I need to get a google search bar on my site. It has to be this code because it is part of a sales thing. Here is the code for the search box

    http://pastie.org/468386

    and here is the script that runs the search

    http://pastie.org/468393

    I need this to work in wordpress. I know there is a search function already, and there are plugins I am sure. but I need this to work. When I try to get it working, I get an error saying call to undefined function. Get header.php. I put the search box in the sidebar then tried putting the code to run the search in the search.php and then set the action to the search.php. But it don’t work. Can you help?

    #57224
    TheDoc
    Member

    I’m pretty sure the search bar used on this site is a Google one, so perhaps you’ll just have to wait for Chris to chime in.

    #57248
    Chris Coyier
    Keymaster

    I’m not sure I understand the problem. What is the goal? To have the search results appear in the sidebar when you do a search? You might be able to do it with an iframe or something so that the page you are currently viewing doesn’t have to reload. Otherwise you’ll have to make the action URL something like "/", which will return you to the homepage with the search results. Or use PHP to grab the current URL and plop that in as the action URL, so a search submit returns you to the current page.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.