Sidebar Search Form Widget

Hi.

Can you tell me which file contains the format of the sidebar search form widget please?

There is /studio/sidebar-search.php, which contains:

<?php dynamic_sidebar( 'sidebar-search' ); ?>

but there is no way I can see to edit widgets. Thanks.

  • Timothy Bowers
    • Chief Pigeon

    You can find the information in:

    /studio/functions.php:

    Around line 128:

    register_sidebar(
    	array(
    		'name'          => __( 'Sidebar Search', 'studio' ),
    		'id'            => 'sidebar-search',
    		'description'   => 'Search Sidebar',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widgettitle">',
            'after_title' => '</h3>'
    	)
    );

    Hope this helps.

  • SRD
    • Design Lord, Child of Thor

    Hi Tim.

    Yes, I found this, but the HTML code output to the browser is:

    <div class="widget widget_search" id="search-3">
    <form action="http://www.example.com/" id="searchform" method="get" role="search">
       <div>
    	<label for="s" class="screen-reader-text">Search for:</label>
    	<input type="text" id="s" name="s" value=""/>
    	<input type="submit" value="Search" id="searchsubmit"/>
       </div>
    </form>
    </div>

    I want to remove the label "Search for:". How do I do this, given the code in functions.php?

    Thanks.

  • Timothy Bowers
    • Chief Pigeon

    I think the search widget actually uses the default one from WP ( I couldn't find the terms in the theme):

    /wp-includes/general-template.php

    Around line 160:

    <form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
    	<div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
    	<input type="text" value="' . get_search_query() . '" name="s" id="s" />
    	<input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
    	</div>
    </form>

    Take care.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.