help getting code to work in wordpress
# May 5, 2009 at 1:39 am
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
and here is the script that runs the search
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?# May 6, 2009 at 4:03 pm
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.# May 7, 2009 at 12:39 am
This reply has been reported for inappropriate content.
I meant that I want the search box in the sidebar of the homepage which I can do. then I want the search results to show up in the content area just like the regular worpress search works. The idea is that it’s a google search which means it pays for the clicks. But it’s no good to create a new page for the thing. I was trying to get it to work like the regular wordpress search but when I put in my search, i get nothing, or it errors on get_header() I can’t figure out how to get the code to work without crashing or returning nothing.
You must be logged in to reply to this topic.