• Resolved Joy

    (@xochocolate)


    I’m trying to include a search bar in my website’s footer using
    <?php get_search_form(); ?>

    Unfortunately, regardless of what keyword I search, all my posts come up in the search results! You can try it here: http://ratanak.org/aatest

    The code for my search form is as follows:

    <form action="<?php bloginfo('siteurl'); ?>" id="searchform" method="get">
         <fieldset>
             <label for="s" class="screen-reader-text">Search for:</label>
             <input type="search" id="s" name="s" placeholder="Enter keywords" required />
             <input type="image" id="searchsubmit" alt="Search" src="<?php bloginfo( 'template_url' ); ?>/images/searchicon.png" />
         </fieldset>
    </form>

    Any help to make the search bar actually search my posts and pages would be much appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Your search form is generating the proper search request, so that’s not where the problem lies. Something in your installation is corrupting search requests, most likely a plugin, though it may be your theme.

    Try deactivating all of your plugins, the search probably will now work. Reactivate each plugin in turn, testing search each time. This will indicate the problem plugin. Seek help from the plugin author.

    If deactivating plugins does not fix the search, switch to one of the default twenty* themes shipped with WordPress. If this fixes search, your theme has an issue, seek help from the theme’s author.

    Thread Starter Joy

    (@xochocolate)

    Thanks bcworkz! I tried deactivating all my plugins, and the search still didn’t work. I’m thinking it’s an issue with the theme as you said, so I’ll have to contact the author.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress search function displaying all my posts (wrong results)’ is closed to new replies.