Hi all,
Does anyone know how to remove the text 'Search For' that's appearing above my search box please? Site can be viewed at http://itreviewed.net/
Thanks very much!
Chris,
Hi all,
Does anyone know how to remove the text 'Search For' that's appearing above my search box please? Site can be viewed at http://itreviewed.net/
Thanks very much!
Chris,
Try looking in your searchform.php.
Weird, I can't find this file anywhere. Which directory should it be in please?
It seems my theme doesn't have a searchform.php.... I've searched the Web and it seems other themes are missing this form too
Try:
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<div>
<label for="s">Keyword(s)</label> <input class="text" type="text" value="<?php if(trim(wp_specialchars($s,1))!='') echo trim(wp_specialchars($s,1));else echo ' ';?>" name="s" id="s" />
<input type="submit" class="submit" name="Submit" value="Search!" />
</div>
</form>
Save the above as searchform.php within your theme's folder.
If you want to hide the input's label, add:
#searchform label {
position:absolute;
top:-1500px;
left:-1500px;
}
to your theme's stylesheet.
Thank you so much Esmi. That worked a treat!
You can remove the "Search for:" text by editing (WP version 2.8) wp-includes\general-template.php
Line 125
<div><label class="screen-reader-text" for="s">' . __('<!--Search for:-->') . '</label>
I commented it out (as seen above) so it wouldn't show. Hope that helps.
Better to hide the text using CSS such as:
label.screen-reader-text {
display: none;
}
or like esmi's code. Otherwise you risk needing to edit the php file again whenever you update WP.
What if I would like to edit the text instead of removing it?
This topic has been closed to new replies.