WordPress.org

Ready to get started?Download WordPress

Forums

Search Box Doesn't work at all and shows weird behavior (5 posts)

  1. chatterbug89
    Member
    Posted 8 years ago #

    I am absolutely stumped as to what I could be doing wrong and i've sat here for almsot a hour search these forums and other places for an answere with no luck. I set up a template for wordpress over at http://www.cybernetresources.com/gigmax/ and for some reason, whenever you try to search for something, it just goes to http://www.cybernetresources.com/index.php . I've tried variouse tips mentioned on the forums with no luck, and I have even tried setting my action to be static by putting http://www.cybernetresources.com/gigmax/ with no luck...same problem. Looking at the source of the page after it's been generated shows the form code to look fine...it doesn't make sense why it would be redirecting. Anyways, here is what I currently have for my form.

    <form method="get" id="searchform" action="<?php bloginfo('siteurl'); ?>">
    <input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
    </form>

    Also, the search does appear to work, if i do something like, http://www.cybernetresources.com/gigmax/index.php?s=test , i can search.

    Any answeres would be greatly appreciated. Also, i thought i'd mention this isn't the first wordpress theme I did...and this is the first time I have had this problem. Also, if i change the theme to the classic theme for example, the search works fine.

  2. brittanie
    Member
    Posted 8 years ago #

    I'm not sure why this happens but it happened to me too when I first started using WP. Here is how I fixed it.

    Notice in the code you posted above, the part that says
    <form method="get" id="searchform" action="<?php bloginfo('siteurl'); ?>">

    The "action" is searching bloginfo('siteurl') which would be cybernetresources.com.

    However, in your case, your WP files are installed in a subdomain, cybernetresources.com/gigmax/index.php.

    Now, in order for the serach to work, you have to change the search destination, or the info contained in that part that says 'siteurl'. Try this:

    <form method="get" id="searchform" action="<?php bloginfo('cybernetresources.com/gigmax/index.php'); ?>">

  3. maerk
    Member
    Posted 8 years ago #

    Actually, try this:

    <form method="get" id="searchform" action="http://cybernetresources.com/gigmax/index.php">

    That should do the trick. And it's a subdirectory, not a subdomain ;)

  4. brittanie
    Member
    Posted 8 years ago #

    Of course. I was drunk.

  5. chatterbug89
    Member
    Posted 8 years ago #

    Yeah...this is the weird part of the situation..which, i guess i diden't explain very clearly. Even if i set the action to http://cybernetresources.com/gigmax/index.php , when I click searh, i always end up at http://cybernetresources.com/index.php . I just changed it and tried it again with no luck. Thanks for the help, but apparently that isn't the problem :( This deffinately is weird. Especialy why it will work with other themes. My theme was derived from the default theme by the way.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags