Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Sidebars & Widgets (http://forum.bytesforall.com/forumdisplay.php?f=14)
-   -   How to add text in Search Widget (http://forum.bytesforall.com/showthread.php?t=188)

sagatr Feb 4, 2009 01:24 PM

How to add text in Search Widget
 
Hi

How can you add text in search box, on the search widget, just before the magnifer.

I want to add the text "search" in the box before the magnifier.

Thanks.

Flynn Feb 4, 2009 01:53 PM

Change searchform.php line 5 from
PHP Code:

<input type="text" class="text inputblur" value="<?php the_search_query(); ?>" name="s" />

to
PHP Code:

<input type="text" class="text inputblur" 
onfocus="this.value='<?php echo (get_search_query() ? get_search_query() : '' ); ?>'" 
value="<?php echo (get_search_query() ? get_search_query() : 'DEFAULT SEARCH TEXT' ); ?>"  name="s" />

Replace DEFAULT SEARCH TEXT with your default search text, i.e. search


tikdi Feb 8, 2009 05:06 AM

:) Thanks, that helped. I was looking for it too.


All times are GMT -6. The time now is 03:28 PM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.