Ready to get started?Download WordPress


search form adding extra (2 posts)

  1. boattraveller78
    Posted 2 years ago #


    I have a widget for a custom search form on my website as the following (which definitely worked in 2010)

    <form method="get" id="search_form" action="<?php bloginfo('home'); ?>/">
    <p>Search for: <input type="text" class="search_input" value="searchstring"
    name="s" id="s" /></p>
    <input type="submit" id="searchsubmit" value="Search" />

    The problem is that the URL I get is

    which does not work because of the '<'


    works fine but I cannot figure out why the '<' is being added.

  2. esmi
    Forum Moderator
    Posted 2 years ago #


    <form method="get" id="searchform" action="<?php echo home_url(); ?>">
    <label for="s" class="offset"><?php _e('Keyword(s)');?></label> <input class="text" type="text" value=" " name="s" id="s" />
    <input type="submit" class="submit button" name="submit" value="<?php _e('Search');?>" />

Topic Closed

This topic has been closed to new replies.

About this Topic