WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Search Not Working - Shows Everything (2 posts)

  1. Ce3ge
    Member
    Posted 2 years ago #

    Hey, so this is my first go at creating a WordPress blog from scratch. I've searched for hours and couldn't find an answer. Here's my problem:

    The search form that I have implemented on my site isn't working properly. When you search for something, it displays all of my posts. For example, when I search for the word "epic" (which is in only one of my posts), it displays all of my posts.

    After the research I've done, the URL I get after I search seems to be correct: http://localhost/wordpress/?s=epic

    Right now I don't have a search.php and I'm falling back on the index.php. This is the code I'm using to generate the search form:

    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
        <div><label class="screen-reader-text" for="s">Search for:</label>
            <input type="text" value="" name="s" id="s" />
            <input type="submit" id="searchsubmit" value="Search" />
        </div>
    </form>

    Any help would be greatly appreciated. I'm pretty green when it comes down to PHP - so keep that in mind. :) Thanks!

  2. Ce3ge
    Member
    Posted 2 years ago #

    I'm not sure what the problem was, but if anyone ends up having the same issue, I used this theme's search form and search.php to help me out: http://digwp.com/2010/02/blank-wordpress-theme/

Topic Closed

This topic has been closed to new replies.

About this Topic