• Resolved callender

    (@jimcallender)


    Hi,

    I am using the 2010 theme – where the search form is located in /wp-includes/general-template.php.

    First of all – how do i make this so the custom code is not overwritten in future upgrades of wordpress

    ===

    Secondly, I want to add autoclear

    onFocus="this.value=''"

    to the form, however when I do, the site breaks, the code is

    function get_search_form($echo = true) {
    	do_action( 'get_search_form' );
    
    	$search_form_template = locate_template('searchform.php');
    	if ( '' != $search_form_template ) {
    		require($search_form_template);
    		return;
    	}
    
    	$form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
    
    	<input type="text" value="search the site ..." name="s" id="s" />
    	<input type="image" src="/i/search-btn.png" alt="go" id="searchsubmit" > 
    
    	</form>';
    
    	if ( $echo )
    		echo apply_filters('get_search_form', $form);
    	else
    		return apply_filters('get_search_form', $form);
    }
Viewing 1 replies (of 1 total)
  • Thread Starter callender

    (@jimcallender)

    cool – i found this link – all sorted – inserted into widget and used css to position the form..

Viewing 1 replies (of 1 total)
  • The topic ‘search form – autoclear on 2010 theme’ is closed to new replies.