How do I edit the free wp plugin "Search"

I have inserted the free wp plugin “Search” on my site at http://www.icbv.net and I need to be able to add a form label to the search input box. I can’t find this plugin in the plugin list or in the advanced text editor so I do not know how to get at the html that generated the form field which is where I can modify the code to add a label to the form field. Please help.

Thanks,

Kathy

  • kathyjf
    • New Recruit

    Hi Successfulgeek and Timothy,

    Thank you both for taking the time to respond to my question. I did find the solution to my problem. The search widget code is contained in a file in my Ithemes Builder child theme folder titled “searchform.php”. I was able to edit this to accomplish what I needed to pass screenreader accessibility. The code below should explain what I needed to do.

    Below, in bold, is code I added to the searchform.php file in the child theme to add form label

    <?php $search_box_default = __( ‘Search site’, ‘it-l10n-BuilderChild-Foundation-Blank’ ); ?>

    <?php $search_box_value = esc_attr( apply_filters( ‘the_search_query’, get_search_query() ) ); ?>

    <?php $search_box_value = ( empty( $search_box_value ) ) ? $search_box_default : $search_box_value; ?>

    <form method=”get” class=”search-form” action=”<?php echo get_option( ‘home’ ); ?>”>

    <label for=”s”>Search This Site</label>

    <input type=”text” value=”<?php echo $search_box_value; ?>” name=”s” id=”s” class=”search-text-box” onfocus=”if(this.value == ‘<?php echo $search_box_default; ?>’:wink: this.value = ”;” onblur=”if(this.value == ”:wink: this.value = ‘<?php echo $search_box_default; ?>’;” />

    <input type=”submit” value=”<?php echo esc_attr__( ‘Search’, ‘it-l10n-BuilderChild-Foundation-Blank’ ); ?>” class=”search-submit-button” />

    </form>

    I would love to find a resource for plugins that are already written to pass the accessibility checker so if either of you are aware of any resources, I would love to get that information.

    Thanks again,

    Kathy

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.