Wordpress: I broke my Search Form. Any ideas?

Discussion in 'HTML & Website Design' started by steelfrog, Aug 4, 2008.

  1. #1
    I have no idea what I did, but my Search function seems to be broken. The page simply refreshes when the form is submitted. Here's the code I currently have in my template which, as far as I know, should work fine.

    
    <form id="search" action="<?php bloginfo('url'); ?>">
      <fieldset>
        <input type="text" id="text" value="<?php the_search_query(); ?>" />
        <input type="image" src="<?php bloginfo('stylesheet_directory'); ?>/images/header_button.gif" id="submitButton" />
      </fieldset>
    </form>
    
    Code (markup):
    The form is at steelfrog.com. When the form is submitted, the URL doesn't seem to parse. It returns a URL like this: http://www.steelfrog.com/?x=0&y=0

    Any ideas? It used to work just fine, and I can't recall making any changes in the form lately.
     
    steelfrog, Aug 4, 2008 IP
  2. lolv2

    lolv2 Banned

    Messages:
    626
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try replacing your code with this one and let me know if the problem presists:

     
    lolv2, Aug 4, 2008 IP
  3. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No, unfortunately that didn't resolve the problem. Do I really need to make a Search Results page? I've never made one before and it worked fine, but I'm wondering if it's something that has changed in the last few upgrades.
     
    steelfrog, Aug 4, 2008 IP
  4. lolv2

    lolv2 Banned

    Messages:
    626
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes, you need to have a search.php page. Without a search results page where will you show the results? :p
     
    lolv2, Aug 4, 2008 IP
  5. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hrmm. Well it used to work without one before; it used the Content template to generate the results. Guess they must have changed that. I'll try it out.
     
    steelfrog, Aug 4, 2008 IP
  6. ozan

    ozan Peon

    Messages:
    82
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not sure what you did to break it, but the fool-proof solution to these sorts of problems is just to copy and modify the relevant files from the default theme.
     
    ozan, Aug 5, 2008 IP
  7. nadiax

    nadiax Banned

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    find out other wp template that provide the search form.
    Backup your version then copy only the search from section and patse to replace yours.
    Test that is it work...
    ^ ^ more quickly than try to fix it...
     
    nadiax, Aug 5, 2008 IP
  8. nhc1987

    nhc1987 Notable Member

    Messages:
    2,674
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #8
    You can choose Google Custom Search as an alternative. No need to work with code, just copy and paste. We also can make money from it, cool ^^
     
    nhc1987, Aug 5, 2008 IP