WordPress.org

Ready to get started?Download WordPress

Forums

Search not working, goes to 404 error page (3 posts)

  1. iversoncru
    Member
    Posted 1 year ago #

    hi there!
    In my blog i have a Search and i have been trying to make it work, but no success.

    <li id="searchs">Search
    	<ul id="search">
    		<form id="searchform" role="search" method="get" action="<?php home_url('/') ?>">
    		<li>
    		<label class="hidden" for="s">Search for:</label>
    		<input id="s" name="s" type="text" value="" autocomplete="off" width="22" height="32" tabindex="1" />
    		</li>
    		<li>
    		<input type="image" name="searchsubmit" id="searchsubmit" value="Submit" src="<?php echo get_stylesheet_directory_uri(); ?>/images/fineblack_blog_searchbutton.png" width="22" height="32" tabindex="2" />
    		</li>
    		</form>
    	</ul>
    </li>

    When i type something to search and click the submit button, it leads me to 404 error page...

    It is my first time and i dont know what is missing.
    I think i have followed: http://codex.wordpress.org/Function_Reference/get_search_form
    but it won't work...

    any ideas? any help? please!!

    thanks in advance for your time :)

  2. iversoncru
    Member
    Posted 1 year ago #

    i can show "search.php" if necessary, but if when i click "submit" leads me to 404 error page, the error must be out of "seach.php"...

  3. iversoncru
    Member
    Posted 1 year ago #

    i dont understand why this happened, since i copied the code from http://codex.wordpress.org/Function_Reference/get_search_form
    and it says:

    action="<?php echo home_url( '/' ); ?>"

    but apparently it was not working well, so i have used

    action="<?php bloginfo('home'); ?>/"

    and now it works perfectly!

    if anyone would like to explain why this happened... i would appreciate!
    thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic