logo

$4
Where can I change the text in the search box widget?

here is a link to my blog site:
http://caligreen.com/chriscutfries/

The default text in the search box currently reads "To search, type and hit enter". I'm lost in all of the files that make up the blog, can anyone point me to the file that defines this message in the text box.

thanks,
chris

chris scott | 05/14/10 at 4:05am | Edit


(5) Possible Answers Submitted...

  • avatar
    Last edited:
    05/14/10
    4:10am
    Utkarsh Kukreti says:

    In the theme folder, searchform.php (or a similar name), find

    <input id="s" name="s" type="text" value="To search, type and hit enter" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" size="32" tabindex="1" />

  • avatar
    Last edited:
    05/14/10
    4:14am
    Gustavo Bordoni says:

    Hi Chris, the following code create a custom Search Box:


    <?php
    function search_nav_menu() { ?>
    <li class='nav_right search'>
    <form class='search_form' method='get' action=''><input type='text' name='s' id='s' value='search' onfocus="if (this.value==='search') this.value='';" onblur="if (this.value=='') this.value='search';"/></form>
    </li>
    <?php
    }
    add_action('thesis_hook_last_nav_item','search_nav_menu');
    ?>


    And you can use this CSS:

    .custom ul.menu li {
    float:right;
    font-size:10px;
    height: 22px;
    letter-spacing:1px;
    overflow:hidden;
    }

    .custom ul.menu li.search {
    background-color: #CCC;
    border-bottom:none;
    height:25px;
    margin-bottom:0;
    }

    .custom ul.menu li.search input {
    background-color: #CCC;
    border:1px solid #333;
    color:#333;
    font-size:10px;
    height:18px;
    letter-spacing:1px;
    padding:4px 10px 0 22px;
    width:125px;
    }

    Previous versions of this answer: 05/14/10 at 4:14am

  • avatar
    Last edited:
    05/14/10
    5:46am
    Oleg Butuzov says:

    Utkarsh Kukreti has right answer, in theme should be the searchform.php

    Previous versions of this answer: 05/14/10 at 5:46am

  • avatar
    Last edited:
    05/14/10
    7:42am
    Ehthisham tk says:

    <?php get_search_form(); ?>
    the above function creates your form .You don't need to use that function just create your form instead of calling the above function create a custom one and just change action=,name= ,and value=[ please see below bolded chars]. then you can style as you needed

    <form name="" action="<?php bloginfo('url'); ?>/" method="post">
    <input type="text" name="s" class="searchtxt" value="<?php the_search_query(); ?>" />
    <input type="submit" name="submit" class="searchbutton" value=""/>
    </form>

  • avatar
    Last edited:
    05/15/10
    5:44pm
    Nehal Rupani says:

    Hi Chris,

    Let me guide you through wordpress.

    1) Go to wordpress root folder->wp-content->themes->your_theme->sidebar.php
    2) Click on function(i guess your using some IDE) for <?php get_search_form(); ?>
    3) it will take you to page from where this functions comes from.
    4) find <input type="textbox"> with in that file and change value attribute like value="Search here..".

    i hope this will help to result some answer.

    • 05/15/10 5:43pm

      chris scott says:

      That wasn't exactly it but it got me looking in the right place, it was in..

      wp-content > themes > thematic > functions.php

      which lead me to:
      wp-content > themes > thematic > library > extensions > widgets-extensions.php

      that's where the code was.
      thanks Nehal

This question has expired.





Current status of this question: Completed