• 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 https://www.cybernetresources.com/gigmax/ and for some reason, whenever you try to search for something, it just goes to https://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 https://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, https://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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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'); ?>">

    Actually, try this:

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

    That should do the trick. And it’s a subdirectory, not a subdomain ??

    Of course. I was drunk.

    Thread Starter chatterbug89

    (@chatterbug89)

    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 https://cybernetresources.com/gigmax/index.php , when I click searh, i always end up at https://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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Search Box Doesn’t work at all and shows weird behavior’ is closed to new replies.