Grow your CSS skills. Land your dream job.

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

    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?

    # May 5, 2009 at 2:06 am

    I found a plugin that should make this code work. I will let you know if I get it to work

    # May 5, 2009 at 2:07 am

    nope, not working. this plugin makes a page. I don’t want a page, i want it on the sidebar.

    # May 6, 2009 at 12:53 pm

    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.

    # 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

    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.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".