WordPress.org

Ready to get started?Download WordPress

Forums

Problems with search box (4 posts)

  1. golfczech2
    Member
    Posted 1 year ago #

    Hi! My website is http://www.thehungrysprout.com and I am having trouble with my search box. If you type in a value to search for, the Feedburner subscription email window pops up. I only have this problem in Chrome.

    I have emptied my cache, deleted all of my plug ins and turned them all on separately and no changes. I have even deleted and reloaded both the search widget and the email subscription widget.

    Does anyone have any other ideas? Again, this is only happening in Chrome- it works great in other browsers and on my Android. UGH!!

    Thank you in advance for any help-

  2. wpismypuppet
    Member
    Posted 1 year ago #

    I get the Feedburner subscription is all browsers. Looking at your source code, your search input box has no form surrounding it. So when you type in the text box and hit enter, it triggers the first form is finds, which is your email signup. I suggest wrapping your search input box in the appropriate "form" tag and even add a submit button, even if you hide it or change the way it looks.

  3. golfczech2
    Member
    Posted 1 year ago #

    OK- I just googled how to wrap an input box- can't seem to find a code that works- does this go into my general CSS file or my individual php areas? One is in my widget and I can add a form wrap to that code pretty easily- but where do I add the form wrap code for the search box? I do not have a searchform.php but it's gotta be somewhere!!!!

    Your response makes total sense because it is doing the same thing on my other blog too. Thank you for responding.....

  4. wpismypuppet
    Member
    Posted 1 year ago #

    How did you place the search box in the sidebar? Did you hard code it yourself? Did you use the search widget?

    If you typed that search box into the sidebar yourself, you can use:

    <?php get_search_form(); ?>

    This will use WordPress default code. If your theme does not have a searchform.php file, WordPress uses a default search form. If you wish to customize the look of the search box, then you'll need to create a searchform.php file. From there, you can add what you need. Here is one I use:

    <?php
    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
     <input type="text" value="" name="s" id="s" />
     <input type="submit" name="submit" value="Search" />
    </form>
    ?>

    Still use the get_search_form() function above and it will now read your searchform.php file instead of a default form.

Topic Closed

This topic has been closed to new replies.

About this Topic